In the CellDataError event there is no context information like which cell had an error. In the event handler I can set the properties to override the default behaviour. But that would only work if I want the same behaviour always.
And then there is Error event which provides context. I don't know what would be the drawback of using 'Error' event over 'CellDataError' event.
BB said:In the CellDataError event there is no context information like which cell had an error.
You can use grid.ActiveCell.
BB said:'Error' event over 'CellDataError' event.
Is there any preference when you would choose between these events?
These events fire for different case. CellDataError fires when the grid cell tries to write it's pending changes to the DataSource and the DataSource throws an exception. The grid catches this exception and fires the event.
The Error event fires for other types of errors that are not necessarily DataSource-related, like masking or copy/paste errors.