Datagrid Validation

Hi, In a datagrid, I would like to compare a cell values to itself (before and after making the changes) and return the cell position if the cell is changed. I tried it with CurrentCellChanged/CurrentCellChanging event handler and it does not seem to work. How do I do it? Please help. Chris

2 Replies

AD Administrator Syncfusion Team February 23, 2004 05:28 PM UTC

CurrentCellChanging fires with every keystroke. CurrentCellValidating fires when you try to leave the cell. If you want to catch every keystroke, then use CurrentCellChanging. If you only want to handle the final changed value, then handle CurrentCellValidating. In both places, you get the values like this: GridCurrentCell cc = this.grid.CurrentCell; string oldValue = this.grid[cc.RowIndex, cc.ColIndex].Text; string newValue = cc.Renderer.ControlText;


AD Administrator Syncfusion Team February 23, 2004 05:46 PM UTC

Thanks a lot.

Loader.
Up arrow icon