dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.06k stars 1.17k forks source link

Datagrid, OnExecutedCommitEdit sometimes has parameter DataGridEditingUnit.Cell and DataGridEditingUnit.Row #9714

Open haileymck opened 1 month ago

haileymck commented 1 month ago

Description

When editing a cell and then switching to another cell in the same row, OnExecutedCommitEdit fires with parameter DataGridEditingUnit.Cell. When editing a cell and then switching to another row, OnExecutedCommitEdit fires with parameter DataGridEditingUnit.Row. This causes the row validation rules not to fire, but I want the row validation rule to fire now.

Reproduction Steps

1) on a datagrid with row and cell validation rules 2) edit a cell in the row and then move to another cell in that row 3) see that the row validation rules are not executed

4) edit a cell in a row and then move to another cell in a different row 5) see that the row validation rules are executed

Expected behavior

only the cell validation rule is executed, the row validation rule is not executed when moving through cells in the same row.

Actual behavior

I want the ability for the row validation rules to be executed when moving through cells in the same row.

Regression?

No response

Known Workarounds

There are none. I cannot edit OnExecutedCommitEdit's parameter to always be DataGridEditingUnit.Row.

Impact

I am working on the VS Resource Explorer and this is the root of a known bug. Please reach out if further information is needed.

Configuration

No response

Other information

No response

miloush commented 1 month ago

I am afraid this is by design. The row is not being committed until you switch the row. Usually the underlying data does not even change until then.