How to get focus on a newly added row.

Hi,

I have a Syncfusion grid and a Add button to add a blank row in the grid control. So now, I want to get focus on first cell of newly created row.

Please help me out to resolve this problem.

 

Thanks,

SG


1 Reply

SK S. Kannan Syncfusion Team June 14, 2012 04:14 AM UTC

Hi SG,

 

Thanks for your update.

 

You can achieve your requirement by using the below code snippets.

 

Code Snippet [C#]

private void Button_Click(object sender, RoutedEventArgs e)

{

     this.gridControl.Model.InsertRows(this.gridControl.Model.RowCount, 1);

     this.gridControl.CurrentCell.MoveTo(this.gridControl.Model.RowCount-1, 1);

}

 

We have created a sample application and it can be downloaded from the below location.

 

Sample Location: http://www.syncfusion.com/downloads/Support/DirectTrac/General/103938-1984165141.zip

 

Please let us know if you have any queries.

 

Regards,

Kannan. S


Loader.
Up arrow icon