Hi Ammar
In
SfDataGrid, we do not have direct support for focusing on the widget loaded in
the cells by key navigation. When we perform selection or key navigation, the
focus is moved to the dataGrid. By default, widgets like TextField get focus when we tap the required
widget. Based on the details provided, you need to trigger the focus for the
TextField using the arrow keys.
We have a
workaround to achieve the expected behavior by using the onCurrentCellActivated callback. This callback is raised after
the current cell is applied in the grid cell on the selected row. In the build row, while adding the TextField, the EmployeeDataSource class manages TextEditingController and FocusNode instances for each row. This ensures
each text field within the grid has its controller and focus node. The focus is
programmatically requested for the corresponding FocusNode in the
onCurrentCellActivated callback. Once the value is committed in the
respective text field by pressing the Enter key, the focus returns to the
SfDataGrid, allowing for continued navigation.
We have
included a sample for your reference. Please review this sample for more
details and adapt it to suit your specific requirements.
Regards,
Abinesh P
Attachment:
SfDataGrid_22d3c499.zip