Reputation: 145
I have a master "gridview" and a detail "gridview" connected to it. The detail "gridview" does not have any columns initially, it loads data from database and it creates its columns. For example, i'm trying to handle cellvaluechanged event, however, even if i write something in a cell of the gridview and then pressing enter, the event is not firing. What can the reason be?
Upvotes: 0
Views: 616
Reputation: 3979
In my opinion the best way to handle this is: Create a class which represent the data from your database. Let the class implement the interface INotifyPropertyChanged
. Then create a BindingList with all Objects from your Database. Now use this BindingList as DataSource for your Grid. The BindingList got the Event ListChanged. This will recognize that a Property Value in your DataSource is changed if you type some new value in cell.
I think this is best practice because you are working with your DataSource and not with GridView directly.
Otherwise the event should fire for sure. If you cant use my idea send some code, maybe i can find the problem then.
regards
Upvotes: 1