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
close icon

Focus on cell to use the keyboard

I'm using a GridControl and setting a selection programatically the first time the form is activated with:

gridControl.Select();
gridControl.Selections.SelectRange(GridRangeInfo.Cell(2, 2), true);

The problem is that the keyboard arrows wont't work until I click the cell, after that all is well. This app I'm working on requires to be (optionally) used without a mouse, so you see the problem.

Paulo

1 Reply

AA Arulraj A Syncfusion Team May 18, 2010 06:38 AM UTC

Hi Paulo,

Thanks for your interest in Syncfusion Products.

To enable the arrow key operations in grid where selection is handled programmatically, you need to activate the respective cell. Using the following code, this can be achieved.

gridControl1.Select();
gridControl1.Selections.SelectRange( GridRangeInfo.Cell(2, 2), true);
gridControl1.CurrentCell.Activate(2, 2); //This method will activate the specified cell on keyPressed event


Here is a sample for your reference.
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=KeyBoardActivation-1964978101.zip


Regards,
Arulraj

Loader.
Live Chat Icon For mobile
Up arrow icon