I have a collection of objects (List) that is bound to a datagridview. How when I add or remove an object from the collection, can it refresh the datagridview without rebinding the control?
A:
- Call the EndCurrentEdit() method of the DataGridView's BindingContext.
- Refresh first the DataGridView and then the Parent (form or other container)
Eric J.
2009-08-11 03:46:21
A:
I also found the way I was thinking of in another question (This one to be specific)... guess I didn't search long enough.
The correct way is for the data-source to implement IBindingList, return true for SupportsChangeNotification, and issue ListChanged events. However, AFAIK, a DataView does this...
by Marc Gravell
Mitch
2009-08-11 04:08:41