Skip to content

Bug: TextInput edit trigger writes initial character to wrong column on new row #297

Description

@tbebekis

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

  1. Create a DataGrid with multiple editable columns (e.g. Id, Name, etc.)
  2. Set:
    EditTriggers = DataGridEditTriggers.TextInput
  3. Bind the grid to a DataGridCollectionView over a DataView (backed by a DataTable)
  4. Navigate to the new item placeholder row
  5. Click on a non-first column (e.g. "Name")
  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions