Hi Sam,
Thank you for contacting Syncfusion support.
We have checked your query. You can achieve your requirement by two way as shown below.
Way 1: You can resolve and get the appropriate column index by considering the ShowRowHeader column as shown in the below code,
Code Snippet:
| private void Button_Click(object sender, RoutedEventArgs e) { var colIndex = this.dataGrid.Columns.IndexOf(this.dataGrid.Columns["QS1"])+(this.dataGrid.ShowRowHeader?1:0); this.dataGrid.MoveCurrentCell(new RowColumnIndex(1, colIndex), true); } |
Way 2: Also, you can use ResolveToScrollColumnIndex method to get the column index as shown below,
Code Snippet:
| private void Button_Click1(object sender, RoutedEventArgs e) { var colIndex = this.dataGrid.Columns.IndexOf(this.dataGrid.Columns["QS1"]); var index1 = this.dataGrid.ResolveToScrollColumnIndex(colIndex); this.dataGrid.MoveCurrentCell(new RowColumnIndex(1, index1), true); } |
Please let us know if you have any query.
Regards,
Muthukumar K