
I'm using Actipro's ThemedDataGrid, which inherits from WPF's DataGrid. I'm encountering an issue where a row is added to the grid even when the user cancels the edit on the last row. The user can cancel the edit by entering edit mode and then losing focus on the data grid. This is causing several problems:
- If the user makes the last row editable but decides not to edit, the newly added row is still displayed.
- If the user makes the last row editable and then shifts to another cell in the same row, a new row is added to the list but not shown in the grid. The user can then delete the last row, and after that, they will not be able to add a new row anymore.
- The new row is only added when the last row enters edit mode and the grid is refreshed after losing focus. I want the new row to be added as soon as the user starts editing any cell in the last row.
I have searched the forums for similar issues and found some related threads, but the suggestions did not help. I tried canceling the edit in the CellEditEnding event after checking if any cell was changed by the user. This cancels the edit but still adds a NewItemPlaceholder to the list, which eventually gets shown in the grid after several clicks.
If anyone has found a workaround or solution for this issue, I would greatly appreciate it.
P.S. This worked fine in WinForms where we had the CurrentCellDirtyStateChanged event, but it no longer works in WPF