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.
Unfortunately, activation email could not send to your email. Please try again.

Order of Events

Thread ID:

Created:

Updated:

Platform:

Replies:

11748 Mar 15,2004 09:13 AM Mar 16,2004 04:15 AM Windows Forms 3
loading
Tags: GridControl
Samuel Jack
Asked On March 15, 2004 09:13 AM

It would be useful if you could include in your documentation something about the order in which Grid Events occur. I have one specific question/problem: I''m using Grid beta 2. I want to know about a change to the value of a cell as soon as it happens, not when the user has moved to another cell. I''ve hooked up to the Grid CurrentCellChanged Event In the handler for that event I examine the current value of the cell that has changed. ( eg with code like _grid[_grid.CurrentCell.RowIndex, _grid.CurrentCell.ColIndex].CellValue) However, the value returned is not the new value but the value but the value before a change was made. For instance, if I select a value from a drop down list, the change event is fired, but the value in the current cell is the previous item that was selected, not the current value. Hope you can help with this Sam

Administrator [Syncfusion]
Replied On March 15, 2004 10:09 AM

In CurrentCellChanged, you should get the current value from the cell renderer.ControlText. When a cell is actively being edited, the value is only known at the level of the cell control. It is not known at the grid level until you leave the cell. Dim newValue As string = Me.Grid.CurrentCell.Renderer.ControlText

Samuel Jack
Replied On March 16, 2004 03:17 AM

What about if cells are changed by another means - programatically, or by pasting in values (which I guess is programatically). Would the CellsChanged event be raised in that case, rather than CurrentCellChanged? Were would I find these new values?

Administrator [Syncfusion]
Replied On March 16, 2004 04:15 AM

If you are typing into a cell, CellsChanging and CellsChanged are only fired when you leave the cell. In CellChanging, you can get the cell that is changing from e.Range. You can get the new value from e.CellsInfo. If you are pasteing, the event is fired for every cell, so the new value will be e.CellsInfo[0].CellValue. But in some circumstances (maybe if you are programatically calling ChangeCells), then e.CellsInfo will have multiple values in it as will e.Range. In CellChanged, the new value is already set into the grid, so you would get it there.

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.

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.

;