10566 : Databound on my own classes

Question

I have created a custom collections ( Inherited from collection collectionbase and implemented the Ilistsource interface) and I used the property gantt1.Grid.RootNodes_DataSource to bind the data to the grid.The grid is filled correctly but when I change a value of the collection by programmatically does not change the value visualized on the grid.

How should i create my custom collection to perform the operation ? WHEN I USE A DATASET LIKE DATASOURCE IT WORKS CORRECTLY.

Answer

IList is enough to populate a component that supports databind. But it is not enough to catch changes to the list; like add and remove, nor to catch content change of a given row.

To successfully handle those events you must fullfill the IBindingList interface. In this interface you raise events when changes are applied.

Leave a Reply