This is a migrated thread and some comments may be shown as answers.

Are there is event that happen when the content in Data Source changes?

1 Answer 74 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sason
Top achievements
Rank 1
Sason asked on 17 Oct 2010, 02:54 PM
Thank you.

1 Answer, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 17 Oct 2010, 03:22 PM
Hello Dror,

There is no event that fires from inside the Grid when the contents of the DataSource changes, but if you have INotifyPropertyChanged objects and using a BindingList or a BindingSource, you can always register to the ListChanged event of that collection and get the notifications from there.

I'm guessing you know what happens when you are using an editor, but if you don't then you can use the following:
 - ValueChanged event is fires when the active editor changes its value.
 - CellValueChanged event instead fires after closing the editor and persisting the value in the data layer.

There is one exception, the ValueChanged event fires when there is no active editor and the cell value (not the underlying data bound value) is changed programmaticaly. Find more information regarding editor related events in the online help.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Tags
GridView
Asked by
Sason
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Share this question
or