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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With