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

How to move focus to specific row or specific cell through code in WinForms GridControl?

Platform: WinForms |
Control: GridControl |
Published Date: April 21, 2015 |
Last Revised Date: December 19, 2019

Focus the grid cell

The focus can be moved to a particular cell or Row by using the CurrentCell.MoveTo() method of the Grid.

C#

//Sets focus to the particular cell.
this.gridControl1.CurrentCell.MoveTo(2, 3, GridSetCurrentCellOptions.SetFocus);
//Sets focus to the particular row.
this.gridControl1.CurrentCell.MoveTo(GridRangeInfo.Row(4));

VB

'Sets focus to the particular cell.
Me.gridControl1.CurrentCell.MoveTo(2, 3, GridSetCurrentCellOptions.SetFocus)
'Sets focus to the particular row.
Me.gridControl1.CurrentCell.MoveTo(GridRangeInfo.Row(4))

 

The following screenshot displays the focused cell.

Current cell focus is moved to another cell

Figure 1: The Current cell Focus is moved to the cell(2,3)

Samples:

C#: SetFocusThroughCode

VB: SetFocusThroughCode

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
ali
Jun 07, 2018

can we do that with spreadsheet ?

Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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

Live Chat Icon For mobile
Live Chat Icon