WPF DataGrid has RowEditEnding but no RowEditEnded

后端 未结 5 1256
生来不讨喜
生来不讨喜 2021-02-19 20:04

I\'ve bound an ObservableCollection to a DataGrid. When I change values in the DataGrid, the RowEditEnding event is raised. But the e.Row.Item is the object before editing, so y

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-19 20:54

    My fresh and IMHO fastest way is to add bool rowEdited=false, then set it to true inside DataGrid_RowEditEnding and put your code for 'editEnded' inside DataGrid_LayoutUpdated:

    if (rowEdited)
    {
        //main code here//
        rowEdited=false;
    }
    

    .

提交回复
热议问题