Hi
I have a datagrid bound to a list. One of my columns is a valuelist. I have created a save button where I iterate my changed rows, however the column with the value list even after a change the DataChanged value shows false and the OriginalValue contains my new value, so I cannot seem to detect whether the user has changed the value or not. It seems to be OK on cells that are tickboxes only on the valuelist cells.
Am I missing something obvious?
Thank you!
Dave
Hi Dave,
DataChanged in the grid means that the grid has changes that have not been saved to the data source. That's the local data source, not neccessarily the database at the back end. The grid only works with the local data source.
So typically, once you leave the cell, the change in the grid is committed to the data source and so the grid's DataChanged is false.
If you need to keep track of changes made to the data source so that you can update the back end, that would be something the data source itself should do. DataTable / DataSet does this, for example.
Hello Mike
Thanks for your help. The problem I have is my list is bound to a System.Collections.Generic.List, this object as far as I can see does not have a way for me to track changes? Is there a way to stop the grid updating the datasource when you leave the cell or ideally row?
As I am struggling to see the uses of the DataChanged property, also my checkbox row does work when I check to see if the DataChanged flag has changed when I iterate, so does this type of column (it is still bound to a column in my datasource) function differently.
Sorry if I am being a little dense.