I have a SfDataGrid
in my Xamarin
code base and in that SfDataGrid
, there is an Entry
for each row. I have to set Focus
to the Entry
when I add an item. I add Items to the SfDataGrid via a popup.
So, are there any events exists to do that? if so, what would be the best way to implement that feature?
<SfDataGrid
SwipeEnded="DataGrid_SwipeEnded">
<SfDataGrid.Columns>
<GridTemplateColumn>
<GridTemplateColumn.HeaderTemplate>
</GridTemplateColumn.HeaderTemplate>
<GridTemplateColumn.CellTemplate>
<DataTemplate>
<CustomEntry
BindingContextChanged="Entry_ContextChanged"
Focused="Entry_Focused">
</CustomEntry>
</DataTemplate>
</GridTemplateColumn.CellTemplate>
</GridTemplateColumn>
</SfDataGrid.Columns>
</SfDataGrid>
Did you read the official document about the sfdatagrid? In the official document, there are all the events can be triggered in the sfdatagrid.
And there is a value changed event seems can meet your requirement:
The SfDataGrid.ValueChanged event will be triggered whenever the current cell’s value has been changed in the GridTextColumn, GridNumericColumn or GridSwitchColumn. This event handler contains the parameter of type ValueChangedEventArgs that contains the following properties.
For more information, you can check the official document.