方法一:
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 获取选中的当前行某列值
最新推荐文章于 2025-06-19 09:39:24 发布