Articles in this section
Category / Section

How to edit SfDataGrid Template column by single tap?

1 min read

When you use the GridTemplateColumn while entering Edit mode on a single tap, SfDataGrid cannot focus on a particular UIElement defined inside GridTemplateColumn.EditTemplate, but rest of the columns go for Edit mode in a single click. Hence, in order to enter the Edit mode on a single tap, you need to set focus to the control loaded inside the DataTemplate, explicitly. To set the focus to the control loaded inside the DataTemplate you can use the attached property FocusManagerHelper.FocusedElement.

The attached property FocusManagerHelper.FocusedElement gives focus to a particular UIElement loaded inside the DataTemplate. So, you can enter the Edit mode in a single tap.

You can refer the following code example.


<Window x:Class="DetailsViewSimple.MainWindow"
                xmlns:syncfusion="" >
   <syncfusion:SfDataGrid x:Name="dataGrid"
                              ItemsSource="{Binding GDCSource}" >
      <syncfusion:GridTemplateColumn HeaderText="GrandTotal" MappingName="GrandTotal" >
                            <TextBlock Text="{Binding GrandTotal}"/>
                            <TextBox Text="{Binding GrandTotal, Mode=TwoWay}" syncfusion:FocusManagerHelper.FocusedElement="True" />


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment