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.

GridGroupingCotrnol - TableControlCurrentCellControlLostFocus

Thread ID:

Created:

Updated:

Platform:

Replies:

47848 Aug 14,2006 11:31 AM Aug 17,2006 05:26 AM Windows Forms 3
loading
Tags: GridControl
Clive Hill
Asked On August 14, 2006 11:31 AM

Hi,

When editing a cell I want to update that cell''s Text (its a TextBox cell) to the old value. It then gets updated once the server has been updated, and propogates its changes back to the client.

I use TableControlCurrentCellStartEditing to capture the old value, and TableControlCurrentCellEditingComplete to set the control text back to old value like:

gcrb.ControlText = oldValueArgs.ToString();

where gcrb is
GridTextBoxCellRenderer.

This works fine if the user hits Enter on the keyboard but if they tab, use arrow keys, or click with mouse elsewhere, the value is not changed back to the old value. Also, for arrow and tab, the icon on the LHS of grid remains as editing (icon of a writing pencil).

I tried using TableControlCurrentCellControlLostFocus to update the cell''s control text, but this has no impact. Again, I use gcrb.ControlText, and I can see that its value is updated in the code, but not in the grid.

Any suggestions?

Administrator [Syncfusion]
Replied On August 15, 2006 08:15 PM

So, you want to let your user type into a cell, but when he leaves it, you catch the new value and reset the cell to its old value? If so, I think you can do this by handling a single event, TableControlCurrentCellAcceptedChanges. Here is a little sample.

http://www.syncfusion.com/Support/user/uploads/WindowsApplication10_5ab5500e.zip

Clive Hill
Replied On August 16, 2006 01:47 PM

Hi Clay,

I noticed that if you edit the cell once, and hit return, the cell goes back to previous value. If you then update the cell again without moving from cell first, the value updates on the grid, i.e. doesn''t revert back to original value.

Actions:
Edit:
1 -> 2 -> 1
Then without moving.
Edit:
1 -> 3 stays as 3.

This occurs on your example project to. I assume this is because the cell gets marked as ahving rejected the change once, so next time doesn''t. Is there a way to reject and then have cell as initial state?

Clive Hill
Replied On August 17, 2006 05:26 AM

I found calling:

cc.ResetCurrentCellWithoutDeactivate();

after cc.RejectChanges() fixes this problem.

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.

;