We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

CurrentCellChanged/Changing vs. CellsChanged/Changing

What''s the difference between the 2 events?

5 Replies

TO Ted Osberg June 16, 2005 10:54 PM UTC

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?

AD Administrator Syncfusion Team June 17, 2005 01:31 AM UTC

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.

TO Ted Osberg June 17, 2005 03:23 PM UTC

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?

AD Administrator Syncfusion Team June 17, 2005 05:18 PM UTC

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 (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?

TO Ted Osberg June 17, 2005 06:40 PM UTC

We are using version

Live Chat Icon For mobile
Up arrow icon