我在数据网格中创建最后一行但在编辑时无法捕获其数据。
private void Save_row_data(object sender, ExecutedRoutedEventArgs e)
{
var row = grid_deduction.SelectedItem as Deductions;
//DataGridRow gridRow = grid_deduction.r as Deductions;
MessageBox.Show(row.card_no);
}
其中Deductions是class而card_no是get get,sett方法。