I''ve noticed that in several Celltypes: RichTextBox, CheckBox, Currency, MaskedEdit when you move to the cell and hit the Delete key on the keyboard only the CellsChanging/CellsChanged events fire, but not the GridCurrentCellChanging/GridCurrentCellChanged events. However, if I were to give input focus to the cell, then all 4 events would fire. For the other CellTypes this is not a problem. Why is this?
ADAdministrator Syncfusion Team June 16, 2005 08:31 PM
CurrentCellChanged/Changing is part of the user editing a current cell. Ie, the user makes a cell current by clicking it or cursoring to it, and then starts to make a change in it. The Changing event is only raised once at the first change (keystroke) to the cell. The Changed event is raised with every change to the cell, not only the first.
CellsChanging/Changed occurred when a cell style about to be saved or has been saved in the grid. So, CellsChanged is raised as your user leave the edited cell. Or, when you paste a range of cells into the grid, or something else causes a style to be saved.
So, for pasteing a range of cells, CurrentCellChanging/Changed is not raised as your user is not directly interacting with a single current cell. But CellsChanging/Changed is hit as styles are being saved.
TOTed OsbergJune 17, 2005 10:23 AM
thanks for the explanation! However, and this concerns pressing the Delete key on the keyboard without actually giving input focus to the cell, all 4 events will fire for all CellTypes except RichTextBox, CheckBox, Currency, and MaskEdit. According to your explanation, the expected behavior for ALL celltypes (when pressing the Delete key) should only be the firing of the CellsChanging/CellsChanged events only. But like I mentioned above, all 4 events DO fire for the other CellTypes except the CellTypes I mentioned above. Am I missing something? Or is that expected behavior?
ADAdministrator Syncfusion Team June 17, 2005 12:18 PM
Not all cell types are equal. So light variations can be depending on how the Delete key is handled within the renderer, e.g. checkbox uses very different code since it does never get the focus and has no imtermediate active state like a textbox.
That said, typical behavior for a textbox and derived renderers is that when you press Delete, the text for the cell is cleared and the the cell is switched into edit mode. At that time you will recive a CurrentCellChanging and CurrentCellChanged event. Once you move the current cell to another cell CellChanging and CellChange will get fired since at that time the underlying data for the cell are changed.
I see the same behavior for MaskedEdit and CurrencyCells in 126.96.36.199 (you can run the MaskEditCells and CurrenyCells example and click on the "Enable Tracing" checkbox to get a log of current cell events). Which version are you using?