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. Image for the cookie policy date

moving around inside a cell using the keyboard

I have an unbound grid with the ActivateCurrentCellBehavior property set to SelectAll, so that the whole content of the cell is selected when the user moves to it. I have also set the Model.Options.EnterKeyBehavior property so that the user can navigate among the cells by pressing the enter key. I''d like the user to be able to user the arrow keys to move the cursor inside the current cell, but instead they move the focus to another cell. Is there a way to alter this behaviour?

4 Replies

AD Administrator Syncfusion Team May 7, 2004 04:58 PM

Normally, in a TextBox cell, if you have a blinking edit cursor in the middle of the text, the arrow keys will move to the edge of text before moving to the next cell. But if the whole text is selected, it just moves to the next cell. There is no property setting that will change this behavior and still let all the text be selected. To get the cell control to use the arrow keys, try handling the CurrentCellControlKeyMessage event.
private void gridControl1_CurrentCellControlKeyMessage(object sender, GridCurrentCellControlKeyMessageEventArgs e)
{
	Keys keyCode = (Keys)((int)e.Msg.WParam) & Keys.KeyCode;
	if(keyCode == Keys.Left || keyCode == Keys.Right)
	{
		e.CallBaseProcessKeyMessage = false;
		e.CallProcessKeyPreview = false;
	}
}


RR Raul Rosenthal May 10, 2004 12:33 AM

I am using version 1.6.x. Does this version support the event you suggested? I am unable to find it in the documentation. If not, can you please suggest a different workaround that works with v1.6? Thank you.


AD Administrator Syncfusion Team May 10, 2004 12:52 AM

It should be in 1.6.1.8. It may not show up in designer Events list in C#, or in the events dropdown in VB, but you should be able to manually add a handler with += in C# or AddHandler in VB.


RR Raul Rosenthal May 11, 2004 08:15 AM

It worked. Thank you.

Loader.
Live Chat Icon For mobile
Up arrow icon