在WPF中,单击DataGrid,如何获取当前点击的行? 比如在MouseDoubleClick事件中,事实上获取的选中行是一个DataRowview,你可以通过以下的方法来获取选中行的数据,需要引用system.IO 和System.Data; var a =this.exDataGrid.selectItem; var b= a as DataRowView; 或者var b=(DataRowView) exDataGrid.selectItem b["FiledName"].To
public void GetCell() { for (int i = 0; i < this.datagrid1.Items.Count; i++) { DataRowView drv = datagrid1.Items[i] as DataRowView; DataGridRow row = (DataGridRow)this.datagrid1.ItemContainer
原文 『WPF』DataGrid的使用 几点说明 这里主要是参考了MSDN中关于DataGrid的说明 这里只会简单说明在WPF中,DataGird最简单的使用方法 对于MSDN中的翻译不会很详细,也不会每一句都翻译. 来自MSDN的内容 Type Name Description Constructors DataGrid Initializes a new instance of the System.Windows.Controls.DataGrid class. Property Ite