方法一:
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:获取当前选中行的某列值
最新推荐文章于 2022-10-05 17:19:37 发布