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.

Keep the cursor in the same cell after pressing Enter key

Thread ID:





31594 Jul 11,2005 08:42 AM Jul 11,2005 11:45 AM Windows Forms 3
Tags: GridControl
Asked On July 11, 2005 08:42 AM

Is that possible to keep the cursor in the same cell of the GridControl after pressing the Enter key? In my application, the GridControl contains parameters for a charts. If the user modifies a cell and presses Enter, he should see the changes in the chart. But if the cursor goes to another cell which corresponding to a different chart, the user would not see the change he made. Thank you very much for help. Jerry

Administrator [Syncfusion]
Replied On July 11, 2005 09:18 AM

Try setting: this.gridControl1.EnterKeyBehavior = GridDirectionType.None; to see if that gives you want you need.

Replied On July 11, 2005 10:35 AM

The cursor stays in the same cell now, but the change for the cell is not "Entered", the event CurrentEditingComplete and KeyPress are not triggered. I will try the KeyUp event to catch the "Enter". Are there other ways to handle keep the cursor in the same cell? Thank you very much. Jerry >Try setting: > >this.gridControl1.EnterKeyBehavior = GridDirectionType.None; > >to see if that gives you want you need.

Administrator [Syncfusion]
Replied On July 11, 2005 11:45 AM

You can try handling the CurrentCellControlKeyMessage and calling CurrentCell.COnfirmChanges there.
private void gridControl1_CurrentCellControlKeyMessage(object sender, GridCurrentCellControlKeyMessageEventArgs e)
	Keys keyCode = (Keys) ((int)e.Msg.WParam) & Keys.KeyCode;
	if(keyCode == Keys.Enter && e.Msg.Msg == 0x100) //WM_KEYDOWN
		e.Handled = true; //no further processing of enter key


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.