使用WPF在DevExpress DataGrid中获取单击的单元格值

时间:2013-07-19 15:52:55

标签: datagrid devexpress wpf-4.0

我在wpf apllication中有一个DevExpress DataGrid,它将包含两列我的问题是我想在DevExpress DataGrid中获得特定的单击单元格值。

请有人帮助我!

1 个答案:

答案 0 :(得分:0)

您可以使用column方法返回的匹配信息识别点击的row handleGridView.CalcHitInfo()

GridHitInfo hitInfo = gridView1.CalcHitInfo(new Point(e.X, e.Y));
if(hitInfo.InRowCell){
    object value = View.GetRowCellValue(hitInfo.RowHandle, hitInfo.Column);
    //...
}

相关帮助文章:Hit Information Overview
相关方法:Identify the Grid's Element Located Under the Mouse Cursor