Reputation: 5299
I have a DevExpress GridControl with BindingSouce. I want to clear a BindingSource and fill it with new data. I do:
var list = new List<MyClass>();
bindingSource.DataSource = list;
//**Do somthing with a data**//
bindingSource.DataSource = listOfMyClassObjects;
And after it i see a big red cross instead my GridControl.
How to clear BindingSource correctly?
Upvotes: 3
Views: 10416
Reputation: 1566
In order to clear the BindingSource
of GridControl
, you can assign null
to it's DataSource
before you fill with new data.
bindingSource.DataSource = null;
bindingSource.DataSource = listOfMyClassObjects;
You might also refer to this StackOverflow question.
Upvotes: 6