I have a wpf application where I using DevExpress GridControl with a TableView inside. My problem is that I want to get the clicked cell. I found on other post that solution:
private void TableView_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
TableViewHitInfo hitInfo = tableView.CalcHitInfo(e.GetPosition(MainControl));
if (hitInfo.InRowCell)
{
object value = gridControl.MainView.GetRowCellValue(hitInfo.RowHandle, hitInfo.Column);
//...
}
}
But grid control doesn't have a property named MainView. What i do wrong? Or have you other solution for my problem?
MainView is the name of the View the GridControl uses in this example. If you have renamed or named your view otherwise you obviously need to also change the code to use that name:
or easier since the view should already be in scope: