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.

How to set current cell on particular row when DataGrid loaded?

SfDataGrid is loaded without any row or cell selection. When SelectionUnit property is set to Row then the row can be selected by setting SelectedIndex or SelectedItem property.
You can select the CurrentCell by invoking SfDataGrid.MoveCurrentCell method.
MoveCurrentCell method accepts two arguments as follows,

  • RowColumnIndex – It receives CurrentCell of RowIndex and ColumnIndex.
  • NeedToClearSelection – It’s optional parameter and Boolean type. When the parameter is ‘true’, clear all the selection in view and then move to CurrentCell when SelectionMode property is set to Extended. When it is ‘false’ select only the CurrentCell.

C#

For Silverlight:

In Silverlight, move current cell selection is achieved by handling ItemsSourceChanged.

Refer the following code example.

C#

 

Here, the CurrentCell is selected based on RowIndex of 5th record in OrdersDetails collection and 4th ColumnIndex by using MoveCurrentCell method.

Sample Links:

WPF

WRT

SilverLight

UWP

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
2473 08/12/2014 01/22/2016 WPF SfDataGrid 4.5 12.1.0.43
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.