I have several cases where I'm using the CellChange event to react to changes in a grid, which usually involves updating another column in the grid. The problem I'm having is that if the user changes back to the original contents of the cell without leaving the cell (either by hitting the Esc key or reentering the original contents) the event doesn't fire and the other columns no longer show the correct information.
The workaround seems to be to use the KeyUp event, along with using the Cell.EditorResolved property to read the correct text out of the cell. It seems to be working, but I think it's a lot of effort to handle a fairly common scenario. I'm wondering if this is the intended behavior and if there's an easier way to do this.
Mike,
I've put Debug.WriteLine statements in the event handler and it's definitely not firing. We do have other event handlers that perform grid actions, and I'm trying to comment out as much of that as possible. However, one thing I noticed is that the AutoCompleteMode of the column has an effect. If I delete the last character (so that the text is no longer in the list) and then reenter it, the event does fire if the mode is set to None, but not if the mode is set to SuggestAppend. If I type another character that results in the text not being in the list the event does fire in either case. The event doesn't fire in either case if I use the Esc key to restore the value to one that's in the list. We're using 11.1 with the service release.
Hi,
CellChange fires on every change to the text of a cell, it makes no difference what the original value was. Are you sure that the event is not firing? Perhaps your code is checking the current Text of the cell against the original value and that's why your code is not getting triggered.
If CellChange is, in fact, not firing when you change the text of the cell back to the original value, then that is clearly a bug.