[DataGrid] Cancel Editing not called if switching between rows #264

Closed
opened 2026-01-29 17:34:24 +00:00 by claunia · 1 comment
Owner

Originally created by @s-dezign on GitHub (Nov 23, 2021).

If DataGrid has DataGridEditMode.Single and user clicked to edit one row and then clicked to edit another row, for the first row it should call CancelEditing event I assume. Because at the moment I can't track it and tell user if he want to save changes for the first row or revert it.

To Reproduce
Steps to reproduce the behavior:

  1. Set EditMode="DataGridEditMode.Single"
  2. Run Application
  3. Click edit first row and modify some data
  4. Without clicking save or cancel click edit on another row
  5. Notice that changes for the first row was applied

Alternatively link your repo with a sample project that can be run.

Expected behavior
CancelEditing event should be triggered for previously edited row

Originally created by @s-dezign on GitHub (Nov 23, 2021). If DataGrid has `DataGridEditMode.Single` and user clicked to edit one row and then clicked to edit another row, for the first row it should call CancelEditing event I assume. Because at the moment I can't track it and tell user if he want to save changes for the first row or revert it. **To Reproduce** Steps to reproduce the behavior: 1. Set `EditMode="DataGridEditMode.Single"` 2. Run Application 3. Click edit first row and modify some data 4. Without clicking save or cancel click edit on another row 5. Notice that changes for the first row was applied Alternatively link your repo with a sample project that can be run. **Expected behavior** `CancelEditing` event should be triggered for previously edited row
Author
Owner

@enchev commented on GitHub (Nov 29, 2021):

Hey @s-dezign,

There is no such DataGrid event CancelEditing. You can use RowEdit to catch when the row is put in edit mode and cancel the changes of previously edit row. You need to keep reference to the item to know the previous edited item.

@enchev commented on GitHub (Nov 29, 2021): Hey @s-dezign, There is no such DataGrid event CancelEditing. You can use RowEdit to catch when the row is put in edit mode and cancel the changes of previously edit row. You need to keep reference to the item to know the previous edited item.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#264