Return Click Next Row

Hi,

Only numeric columns (SİPARİS) can be edited. But how do I go to the next row when the return button is clicked after the editing is finished. 
And when the cell is clicked, the rows will be scrolled to the top of the keyboard.

note: if there is a cell in the continuation, this will be done. if it is in the last line the keyboard will be closed.

<ContentPage.Content>
    <cards:SfCardView ShadowColor="Black" HasShadow="True" Margin="5" Padding="5">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="2*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="4*"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Image Grid.Row="0" VerticalOptions="StartAndExpand" x:Name="image_Colors"  Source="{Binding colors[0].productImage}" Aspect="AspectFit" HeightRequest="150" WidthRequest="120">
                <Image.GestureRecognizers>
                    <TapGestureRecognizer x:Name="tapImage" Tapped="tapImage_Tapped" NumberOfTapsRequired="1" />
                </Image.GestureRecognizers>
            </Image>
            <StackLayout Grid.Row="1" VerticalOptions="CenterAndExpand">
                <Label x:Name="_inventoryCode" HorizontalOptions="Center" FontSize="Title" FontAttributes="Bold" />
                <Label x:Name="_inventoryName" HorizontalOptions="Center" FontSize="Subtitle" />
                <Label x:Name="_fabric" HorizontalOptions="Center" FontSize="Small" />
            </StackLayout>
            <StackLayout Grid.Row="2">
                <sfListView:SfListView x:Name="sfListview_Colors" ItemTapped="sfListview_Colors_ItemTapped" Orientation="Horizontal">
                    <sfListView:SfListView.ItemTemplate> 
                        <DataTemplate>
                            <StackLayout>
                                <Image x:Name="Button_ChangeColor" Source="{Binding color, StringFormat='{0}.png'}"/>
                                <Label Text="{Binding color}" HorizontalOptions="Center" FontSize="9"/>
                            </StackLayout>
                        </DataTemplate>
                    </sfListView:SfListView.ItemTemplate>
                </sfListView:SfListView>
            </StackLayout>
            <StackLayout Grid.Row="3" VerticalOptions="FillAndExpand">
                <sfDataGrid:SfDataGrid x:Name="sfDataGrid_Colors" CurrentCellEndEdit="sfDataGrid_Colors_CurrentCellEndEdit" SelectionMode="Single" EditTapAction="OnTap" NavigationMode="Cell" AllowEditing="True" ColumnSizer="Star" GridLoaded="sfDataGrid_Colors_GridLoaded" AutoGenerateColumns="False">
                    <sfDataGrid:SfDataGrid.Columns>
                        <sfDataGrid:GridTextColumn HeaderText="BEDEN" MappingName="size" AllowEditing="False" />
                        <sfDataGrid:GridTextColumn HeaderText="STOK" MappingName="stock" AllowEditing="False"  Format="N0" IsHidden="True"/>
                        <sfDataGrid:GridNumericColumn HeaderText="SİPARİŞ" MappingName="orderQuantity" AllowEditing="True" Format="N0" NumberDecimalDigits="0" AllowNullValue="true" NullValue="0" NullText="0"/>
                    </sfDataGrid:SfDataGrid.Columns>
                </sfDataGrid:SfDataGrid>
            </StackLayout>
            <sfButton:SfButton Grid.Row="4" VerticalOptions="CenterAndExpand" x:Name="Button_AddBasket" Text="Sepete Ekle" Clicked="Button_AddBasket_Clicked"/>
        </Grid>
    </cards:SfCardView>
</ContentPage.Content>

10 Replies 1 reply marked as answer

KK Karthikraja Kalaimani Syncfusion Team September 18, 2020 08:07 AM UTC

Hi Tayyip,

By using the BeginEdit method, we can go to the next row when the current cell editing is finished on CurrentCellEndEdit event of SfDataGrid. Please refer the below code snippet.

 
Code snippet  :

 
<syncfusion:SfDataGrid x:Name="myGrid"  
                               AllowEditing="True"  
                               NavigationMode="Cell" 
                               ItemsSource="{Binding mycollect}" 
                               SelectionMode="Single"  
                               ColumnSizer="Star" CurrentCellEndEdit="myGrid_CurrentCellEndEdit" 
                               AutoGenerateColumns="False"> 
            <syncfusion:SfDataGrid.Columns> 
                <syncfusion:GridTextColumn MappingName="Text" AllowEditing="False"></syncfusion:GridTextColumn> 
                <syncfusion:GridTextColumn MappingName="No_1" AllowEditing="False"></syncfusion:GridTextColumn> 
                <syncfusion:GridNumericColumn MappingName="No_2"></syncfusion:GridNumericColumn> 
            </syncfusion:SfDataGrid.Columns> 
        </syncfusion:SfDataGrid>
……
        private void myGrid_CurrentCellEndEdit(object sender, GridCurrentCellEndEditEventArgs e) 
        { 
            myGrid.BeginEdit(myGrid.CurrentCellManager.RowColumnIndex.RowIndex + 1, myGrid.CurrentCellManager.RowColumnIndex.ColumnIndex); 
        } 

Regards,
Karthik Raja 



TE Tayyip Emre ÖRNEK replied to Karthikraja Kalaimani September 18, 2020 03:19 PM UTC

Hi Tayyip,

By using the BeginEdit method, we can go to the next row when the current cell editing is finished on CurrentCellEndEdit event of SfDataGrid. Please refer the below code snippet.

 
Code snippet  :

 
<syncfusion:SfDataGrid x:Name="myGrid"  
                               AllowEditing="True"  
                               NavigationMode="Cell" 
                               ItemsSource="{Binding mycollect}" 
                               SelectionMode="Single"  
                               ColumnSizer="Star" CurrentCellEndEdit="myGrid_CurrentCellEndEdit" 
                               AutoGenerateColumns="False"> 
            <syncfusion:SfDataGrid.Columns> 
                <syncfusion:GridTextColumn MappingName="Text" AllowEditing="False"></syncfusion:GridTextColumn> 
                <syncfusion:GridTextColumn MappingName="No_1" AllowEditing="False"></syncfusion:GridTextColumn> 
                <syncfusion:GridNumericColumn MappingName="No_2"></syncfusion:GridNumericColumn> 
            </syncfusion:SfDataGrid.Columns> 
        </syncfusion:SfDataGrid>
……
        private void myGrid_CurrentCellEndEdit(object sender, GridCurrentCellEndEditEventArgs e) 
        { 
            myGrid.BeginEdit(myGrid.CurrentCellManager.RowColumnIndex.RowIndex + 1, myGrid.CurrentCellManager.RowColumnIndex.ColumnIndex); 
        } 

Regards,
Karthik Raja 


Thank you for answer.
But it didn't. When I press the return key, only the keyboard turns off.


KK Karthikraja Kalaimani Syncfusion Team September 21, 2020 12:20 PM UTC

Hi Tayyip,

We didn’t handle the keyboard in our source. So, we need time to validate your requirement. So, we update further details on or before 23rd September 2020. We appreciate your patience until then.

Regards,
Karthik Raja 



TE Tayyip Emre ÖRNEK replied to Karthikraja Kalaimani September 21, 2020 03:06 PM UTC

Hi Tayyip,

We didn’t handle the keyboard in our source. So, we need time to validate your requirement. So, we update further details on or before 23rd September 2020. We appreciate your patience until then.

Regards,
Karthik Raja 


Thank you for interested


KK Karthikraja Kalaimani Syncfusion Team September 22, 2020 02:22 PM UTC


Hi Tayyip,

Thanks for the update. Currently, we are working on your requirement. So, we will update the details on 23rd September 2020. We appreciate your patience until then.

Regards,
Karthik Raja



KK Karthikraja Kalaimani Syncfusion Team September 23, 2020 01:09 PM UTC

Hi Tayyip,

We need some more time to work on this. So, we will update the details on or before 25th September 2020. We appreciate your patience until then.

Regards,
Karthik Raja



TE Tayyip Emre ÖRNEK replied to Karthikraja Kalaimani September 29, 2020 05:23 PM UTC

Hi Tayyip,

We need some more time to work on this. So, we will update the details on or before 25th September 2020. We appreciate your patience until then.

Regards,
Karthik Raja


Did you find a result?
Thanks.


KK Karthikraja Kalaimani Syncfusion Team September 30, 2020 08:00 AM UTC

Hi Tayyip,

Sorry for the miscommunication,

We can hook the Completed event of GridNumericColumn by writing the custom class for GridNumericColumn. For more details please refer to the below code example and attached sample.


 
……
   this.myGrid.CellRenderers.Remove("Numeric"); 
   this.myGrid.CellRenderers.Add("Numeric", new CustomNumericRenderer());
…..
        private async void myGrid_CurrentCellEndEdit(object sender, GridCurrentCellEndEditEventArgs e) 
        { 
            await Task.Delay(100); 
            myGrid.BeginEdit(myGrid.CurrentCellManager.RowColumnIndex.RowIndex + 1, myGrid.CurrentCellManager.RowColumnIndex.ColumnIndex); 
        }

    public class CustomNumericRenderer : GridCellNumericRenderer 
    { 
         
        public CustomNumericRenderer() 
        { 
             
        } 
 
        protected override SfNumericTextBoxExt OnCreateEditUIView() 
        { 
            var view = new NumericTextBox(this.DataGrid); 
            return view; 
        } 
    } 
 
    public class NumericTextBox : SfNumericTextBoxExt 
    { 
        SfDataGrid dataGrid; 
        /// <summary> 
        /// Initializes a new instance of the <see cref="NumericTextBoxView"/> class. 
        /// </summary>  
        public NumericTextBox(SfDataGrid sfDataGrid) 
        { 
            dataGrid = sfDataGrid; 
            this.Completed += NumericTextBox_Completed; 
        } 
 
        private void NumericTextBox_Completed(object sender, EventArgs e) 
        { 
            dataGrid.EndEdit(); 
        } 
    } 



Marked as answer

TE Tayyip Emre ÖRNEK replied to Karthikraja Kalaimani September 30, 2020 06:35 PM UTC

Hi Tayyip,

Sorry for the miscommunication,

We can hook the Completed event of GridNumericColumn by writing the custom class for GridNumericColumn. For more details please refer to the below code example and attached sample.


 
……
   this.myGrid.CellRenderers.Remove("Numeric"); 
   this.myGrid.CellRenderers.Add("Numeric", new CustomNumericRenderer());
…..
        private async void myGrid_CurrentCellEndEdit(object sender, GridCurrentCellEndEditEventArgs e) 
        { 
            await Task.Delay(100); 
            myGrid.BeginEdit(myGrid.CurrentCellManager.RowColumnIndex.RowIndex + 1, myGrid.CurrentCellManager.RowColumnIndex.ColumnIndex); 
        }

    public class CustomNumericRenderer : GridCellNumericRenderer 
    { 
         
        public CustomNumericRenderer() 
        { 
             
        } 
 
        protected override SfNumericTextBoxExt OnCreateEditUIView() 
        { 
            var view = new NumericTextBox(this.DataGrid); 
            return view; 
        } 
    } 
 
    public class NumericTextBox : SfNumericTextBoxExt 
    { 
        SfDataGrid dataGrid; 
        /// <summary> 
        /// Initializes a new instance of the <see cref="NumericTextBoxView"/> class. 
        /// </summary>  
        public NumericTextBox(SfDataGrid sfDataGrid) 
        { 
            dataGrid = sfDataGrid; 
            this.Completed += NumericTextBox_Completed; 
        } 
 
        private void NumericTextBox_Completed(object sender, EventArgs e) 
        { 
            dataGrid.EndEdit(); 
        } 
    } 



Thanks for your help. it was definitely what I Want


KK Karthikraja Kalaimani Syncfusion Team October 1, 2020 05:02 AM UTC

Hi Tayyip,

Thanks for the update. We glad to know that your requirement has been achieved at your end. Please let us know if need further assistance from this.

Regards,
Karthik Raja 


Loader.
Up arrow icon