Home Forums WinForms controls Xceed Grid for WinForms DataGridView.IsCurrentRowDirty equivalent? Reply To: DataGridView.IsCurrentRowDirty equivalent?

User (Old forums)
Member
Post count: 23064

Unfortunately, this does not exits, but it is possible to implement something that should do the trick.

The InsertionRow kind of does that.  You can subscribe to the the EditEnded of the InsertionRow, because this is raised only when there is something modified in it, else it is the EditCanceled that is raised.

For DataRow, EndEdit is always raised, so it is not usable as with the InsertionRow.  You could subscribe to the ValueChanged event on the DataRowTemplate cells, and to the EditCanceled and EditEnded events of the DataRowTemplate.  In the ValueChanged event handler, if you are still in edition mode, you can place in the Tag property a flag set to true (dirty).  In the EditCanceled, set the flag to false.  In the EditEnded, if the flag is true, then do the “dirty” stuff, if the flag is false, do nothing.

On the side, certain data sources like DataTable and DataView have a built-in “dirtiness” feature.  If you are bound to such a source, at the EditEnded event, you could retrieve the DataRow in the source that corresponds to the row in the grid, verify its dirty flag, and do the corresponding action.

 

Imported from legacy forums. Posted by André (had 1063 views)