Home Forums WinForms controls Xceed Grid for WinForms Using CellValueChanged in a bound grid Reply To: Using CellValueChanged in a bound grid

User (Old forums)
Post count: 23064

Investigating this further, the above applies for modification made by a user to a specific cell in the grid.

However, when changes are made in the DataSet to which the grid is bound, the behavior of the grid is different.

The reason why the ValueChanged is not raised is that the grid has no mean to know which cell has changed, precisely.

IBindingList notifies that the item (the record, thus the row) as changed, but nothing indicates which property (cell) has changed on the item.

So, in this case, the implementation that was chosen was to raise a global row event (CellValueChanged), and not for every cell of the row (ValueChanged ). Raising the ValueChanged for every cell would have been overkilled.

In your case, one possible solution for this problem would be to keep a buffer of the “old values” for the column that you want to monitor, and if it has changed when a row.CellValueChanged is raised, then perform the task required. However, this may not give you any gain, if you only need to make a single comparison to know to which color you need to change the row. If it requires more calculation, then it may be a valid option.

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