Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
650
WinGrid picking up modification to item in BindingList
posted

I have a BindingList<T> and a grid bound to that collection.

I see when I add and remove items from the list the grid updates with those modifications.

However it does not update when an item in that list changes.

How can I get this to happen?

UPDATE:  It seems that this might be a grid painting issue. If I click on the row for the item that has been modified it then refreshes with the new values.  How can I resolve this?

UPDATE 2 : Calling Grid.Refresh() shows the updated value as well. This can't be right?

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi,

    The BindingList will send notifications to the grid that something has changed when it knows about the changes. The BindingList knows, for example, when you add or remove items from the list.

    But if you change a property on an item in the list, there's no way for the BindingList to know that this happened - unless the objects in your list implement the INotifyPropertyChanged interface and send notifications when something changes.

    When you mouse over the grid or call Refresh, the grid paints the cells and it asks for the values from the DataSource, so that's why that works. But it's not very efficient.

Reply Children