方法一:
DataRowView mySelectedElement = (DataRowView)dataGrid1.SelectedItem;
string result = mySelectedElement.Row[0]ToString();
方法二:
var a = this.dataGrid1.SelectedItem;
var b = a as DataRowView;
string result = b.Row[0].ToString();
【转】WPF DataGrid 获取选中的当前行某列值
时间: 2024-10-10 09:41:10