【发布时间】:2015-06-04 09:55:15
【问题描述】:
我的DataGrid 绑定到DataTable。在网格中的每个单元格编辑后,我需要获取新的DataRow 值。只有在焦点从行而不是单元格中丢失后,我才会获得新值。
<DataGrid ItemsSource="{Binding}" CellEditEnding="grid_CellEditEnding"/>
private void grid_CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
//Both the DataTable and the row obtained from "e" has the old row.
}
我应该怎么做才能获得新的DataRow?
【问题讨论】:
-
这是正常的,在 CellEditEnding 中你只有正在编辑的行的信息
-
@demonplus 我确实想要编辑的行。在我使用的那个方法中,我只得到了旧的行值,而我想要新的行值。
-
你会如何处理新的行信息?