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.

moving around inside a cell using the keyboard

Thread ID:

Created:

Updated:

Platform:

Replies:

13714 May 7,2004 06:34 AM May 11,2004 08:15 AM Windows Forms 4
loading
Tags: GridControl
Raul Rosenthal
Asked On May 7, 2004 06:34 AM

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?

Administrator [Syncfusion]
Replied On 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;
	}
}

Raul Rosenthal
Replied On 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.

Administrator [Syncfusion]
Replied On 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.

Raul Rosenthal
Replied On May 11, 2004 08:15 AM

It worked. Thank you.

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.

;