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

Tabbing within changed cell

Thread ID:

Created:

Updated:

Platform:

Replies:

57386 Mar 2,2007 03:44 PM UTC Mar 7,2007 10:13 PM UTC WinForms 3
loading
Tags: GridControl
Chris
Asked On March 2, 2007 03:44 PM UTC

Hello,

I've got a grid with a number of editable columns. Some of them are integer or double cells, and some are text cells.

When a user edits the contents of a cell and hits the TAB key, I want the grid to process and validate those changes and move to the next cell to the right (similar to the way that it handles an ENTER key press, although the enter key is configured to move to the next cell down).

Right now if the user makes a change in the cell and presses TAB it processes the change but stays inside the changed cell.

I'm guessing this would involve capturing a key press. What I'd like to do is capture the TAB key press, run a method that say 'this cell has changed, do whatever validation is necessary', then run a method that says 'Process the tab key press'.

Do those methods exist, or is there a simple flag somewhere that I can set?

Thanks!

Chris

Administrator [Syncfusion]
Replied On March 2, 2007 06:12 PM UTC

Hi Chris,

Please refer to this KB article( What are the different validation events and event members? When are they triggered and how are they used? ) for more details on Validation of a cell. This will help you.

Best regards,
Haneef

Chris
Replied On March 7, 2007 09:09 PM UTC

Hi Haneef,

Thanks for the link. The content was informative, but didn't seem to apply to my specific situation.

I'm trying to get the following behavior:

1) When a user clicks the 'tab' key within an unchanged cell, the current cell moves one cell to the right. If the current cell is the right-most cell,t he current cell should loop around to the first cell in the next row.
2) When the user clicks the 'tab' key with an edited cell, I want the CellValidating event to fire (which sends the updated value to the database), then the current cell should move one cell to the right. Again, if the cell is the right-most cell it should loop around the first cell in the next row.

I can't seem to get this behavior. Currently if the user presses the tab key without editing anything everything works as expected. The current cell moves and loops around to the next row just fine.

However if the user edits a cell and clicks the 'tab' key, the validating event fires and the validation happens, but the current cell remains current.

Any thoughts on how I can fix it?

Thanks,

Chris Rutledge



>Hi Chris,

Please refer to this KB article( What are the different validation events and event members? When are they triggered and how are they used? ) for more details on Validation of a cell. This will help you.

Best regards,
Haneef

Administrator [Syncfusion]
Replied On March 7, 2007 10:13 PM UTC

Hi Chris,

Are you setting the e.Cancel to TRUE in your any one validating event like CurrentCellValidating? If yes, it locks current cell moving in a grid. You need to move the current cell after validating, you should set the e.Cancel to false.

Try setting the WrapCellBehavior property to true to move the first column next row cell in a grid while pressing the TAB key.

this.gridDataBoundGrid1.Model.Options.WrapCellBehavior = GridWrapCellBehavior.WrapRow;

private void gridDataBoundGrid1_CurrentCellValidating(object sender, System.ComponentModel.CancelEventArgs e)
{
MessageBox.Show("Validating Fired");
}

Best regards,
Haneef

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

;