AD
Administrator
Syncfusion Team
August 19, 2004 10:58 AM UTC
You will have to do this yourself.
The grid does not normally cache any cell values other than the current value saved in the grid cell. So, if you want to know the if values are changed or new or ???, you will have to cache these values somehow tracking things yourself.
You can handle the SaveCellInfo event, and in that event use e.RowIndex, e.COlIndex, e.Style.CellValue (new value), and grid[e.RowIndex, e.ColIndex].CellValue (oldValue) to set up your cache of changed values.
You could subscribe to the PrepareViewStyleInfo event and if e.RowIndex, e.ColIndex point to a row/col in your cache, you would set e.Style.BackColor accordingly.
Now if you grid supports moving rows/column, this complicates things a little. In that case, instead of using a separate cache to save the changes, you may want to put a custom object in e.Style.Tag in SaveCellInfo that holds the information about the changes. This way, when the rows/cols move, the information moves with them.
The above assumes you are using aGridControl to hold the data. If you are using a virtual grid or a GridDataBoundGrid, then you would have to use a separate cache to save information as these grids do not store anything in their data object.