Hi,
Whenever the mouse cursor is on the ultragrid, i want to get the row which is under the mouse cursor.
i tired with MouseEnterElement and MouseHover event of the grid and wrote following line of code to get the row, but ended up with exception(cannot cast UltraGrid to UltraGridRow).
UltraGridRow uRow; uRow = (UltraGridRow)sender;
what is the right way to get a row under mouse cursor.?
Thanks,Chitra
HOWTO:UltraWinGrid Mouse Position and Row Identification
Hi mike ,
Can you please provide me (UltraWinGrid Mouse Position and Row Identification) code in C# , i am not able to find X and Y cordinates ....
THanks
chitra
Hello Chitra,
I am just checking about the progress of this issue. Let me know if you need our further assistance on it.
Thank you for using Infragistics Components.
Hi Chitra,
You can get the X and Y coordinates from he event arguments. But you don't absolutely need them:
private void ultraGrid1_MouseMove(object sender, MouseEventArgs e) { UltraGrid grid = (UltraGrid)sender; UIElement element = grid.DisplayLayout.UIElement.LastElementEntered; if (null == element) return; if (!(element is RowUIElement)) element = element.GetAncestor(typeof(RowUIElement)); if (null == element) return; UltraGridRow row = element.GetContext(typeof(UltraGridRow)) as UltraGridRow; if (null == row) return; Debug.WriteLine(row.Index, "The mouse is over row:"); }