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

How to move focus to next row on commit?

Thread ID:





131896 Aug 2,2017 04:23 AM UTC Aug 3,2017 07:44 PM UTC Xamarin.Forms 1
Tags: SfDataGrid
Gangatharan Baskaran
Asked On August 2, 2017 04:23 AM UTC

I have a sfDataGrid and it has one editable column. How can I move focus to the next row on commit the previous row?

Ashok N [Syncfusion]
Replied On August 3, 2017 07:44 PM UTC

Hi Gangatharan, 
Thanks for contacting Syncfusion support. 
You can achieve your requirement by handling CurrentCellBeginEdit event and set the SelectedIndex based on the current edited row. Please refer the below code example  
public partial class SfDataGridPage : ContentPage 
    int currentRowIndex = -1; 
    public SfDataGridPage() 
        dataGrid.CurrentCellBeginEdit += DataGrid_CurrentCellBeginEdit; 
    private async void DataGrid_CurrentCellBeginEdit(object sender, GridCurrentCellBeginEditEventArgs args) 
        await Task.Delay(100); 
        var row = dataGrid.GetRowGenerator().Items.FirstOrDefault(x => x.RowIndex == args.RowColumnIndex.RowIndex); 
        currentRowIndex = args.RowColumnIndex.RowIndex; 
        var column = (row.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name == "VisibleColumns").GetValue(row) as List<DataColumnBase>).FirstOrDefault(x => x.ColumnIndex == args.RowColumnIndex.ColumnIndex); 
        if (((column as IElement).Element as ContentView).Content is Entry) 
            (((column as IElement).Element as ContentView).Content as Entry).Completed += Entry_Completed; 
    private async void Entry_Completed(object sender, EventArgs e) 
        await Task.Delay(500); 
        this.dataGrid.SelectedIndex = currentRowIndex + 1; 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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