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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Keep the cursor in the same cell after pressing Enter key

Thread ID:

Created:

Updated:

Platform:

Replies:

31594 Jul 11,2005 12:42 PM UTC Jul 11,2005 03:45 PM UTC WinForms 3
loading
Tags: GridControl
jsun@doble.com
Asked On July 11, 2005 12:42 PM UTC

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 01:18 PM UTC

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

jsun@doble.com
Replied On July 11, 2005 02:35 PM UTC

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 03:45 PM UTC

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.gridControl1.CurrentCell.ConfirmChanges();
	}
}

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

;