Hi,
What is the best way of getting the row data object from a xamgrid in right mouse up event?
Thanks
Jim
Hello Jim,
The best way would be to handle the XamGrid's PreviewMouseRightButtonDown event, instantiate a new CellControl via the Infragistics Utilities class, and reference Cell.Row.Data.
eg.
private void xg1_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
CellControl cell = Utilities.GetAncestorFromType(e.OriginalSource as DependencyObject, typeof(CellControl), true) as CellControl;
var rowDetails = cell.Cell.Row.Data;
}
Let me know if you have any questions.
Thank you, that was exactly what I needed.
Hold that. Just tried it and the cell value is always null. I'm not selecting the row to make it the active one. I'm just doing a right mouse click on a row on the grid and getting a null value for cell using the code above.
Can you review the sample attached? Each cell click captures the underlying cell value.
Thanks, the example works fine. But same code in my app returns a null reference for the Cellcontrol. I'll look into it further to see if I can work out what the issue is.
Hello,
Thank you for informing us. If you have any questions when are able to provide more details please do not hesitate to ask. Thank you.