I have successfully bound my DataGridView to a list. But, the grid doesn’t refresh when I programatically change some of the properties of one of the objects within the list. If I click in the cell (or minimize and then maximize form), the displayed value is refreshed.
I read here that I should use a BindingList. The list I am using is an interface type which doesn’t implement IBindingList. But, the concrete type being used to initialize the list does inherit off of BindingList. Any ideas?
Your list must implement
IBindingList(or be aBindingList) and your object must implementINotifyPropertyChanged. Both conditions are required for your DataGridView to bind properly.So if your data source would be, for instance,
MyList<MyClass>,MyListmust implementIBindingListandMyClassmust implmenentINotifyPropertyChanged.Here is a neat example: http://crazorsharp.blogspot.com/2009/06/inotifypropertychanged-how-to-and-when.html