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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CurrentCellChanged/Changing vs. CellsChanged/Changing

Thread ID:

Created:

Updated:

Platform:

Replies:

30383 Jun 16,2005 09:56 PM UTC Jun 17,2005 06:40 PM UTC WinForms 5
loading
Tags: GridControl
Ted Osberg
Asked On June 16, 2005 09:56 PM UTC

What''s the difference between the 2 events?

Ted Osberg
Replied On 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?

Administrator [Syncfusion]
Replied On 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.

Ted Osberg
Replied On 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?

Administrator [Syncfusion]
Replied On 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 3.2.1.0 (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?

Ted Osberg
Replied On June 17, 2005 06:40 PM UTC

We are using version 2.0.5.1

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;