Description
When using EditTriggers = DataGridEditTriggers.TextInput, typing into a cell of the new item placeholder row causes the initial character to be written to the wrong column (typically the first editable column), instead of the cell where the user started typing.
Expected Behavior
When the user types into a specific cell (e.g. "Name") of the new row placeholder:
- A new row should be created
- Editing should begin in the same cell (e.g. "Name")
- The typed character should appear in that cell only
Actual Behavior
- A new row is created
- The initial typed character is written into the first editable column (e.g. "Id")
- Focus may move or remain inconsistent
- The intended target cell (e.g. "Name") does not receive the initial input correctly
Reproduction Steps
- Create a DataGrid with multiple editable columns (e.g.
Id, Name, etc.)
- Set:
EditTriggers = DataGridEditTriggers.TextInput
- Bind the grid to a
DataGridCollectionView over a DataView (backed by a DataTable)
- Navigate to the new item placeholder row
- Click on a non-first column (e.g. "Name")
- Type a character
Result
The character is written to the first column instead of the selected column.
Notes
- The issue does not occur when editing existing rows
- The issue appears only when editing starts via
TextInput on the new row placeholder
- Using other edit triggers (e.g.
CellDoubleClick) avoids the problem
- This seems related to how the grid initializes the current cell during new row creation
Environment
- ProDataGrid version: (11.3.11-preview.20)
- Avalonia version: (11.3.12)
- OS: (Linux Mint 21.3 Cinnamon )
Additional Info
It appears that during the creation of the new row, the grid resets the current cell to the first editable column before applying the initial text input.
Description
When using
EditTriggers = DataGridEditTriggers.TextInput, typing into a cell of the new item placeholder row causes the initial character to be written to the wrong column (typically the first editable column), instead of the cell where the user started typing.Expected Behavior
When the user types into a specific cell (e.g. "Name") of the new row placeholder:
Actual Behavior
Reproduction Steps
Id,Name, etc.)EditTriggers = DataGridEditTriggers.TextInputDataGridCollectionViewover aDataView(backed by aDataTable)Result
The character is written to the first column instead of the selected column.
Notes
TextInputon the new row placeholderCellDoubleClick) avoids the problemEnvironment
Additional Info
It appears that during the creation of the new row, the grid resets the current cell to the first editable column before applying the initial text input.