views:

807

answers:

3

Does anyone know if the Infragistics UltraGrid control provides functionality similar to that of DataGridView.HitTestInfo?

A: 

There's a .MousePosition property which returns System.Drawing.Point and "Gets the position of the mouse cursor in screen coordinates" but I'm using an older version of their UltraWinGrid (2003).

They have a free trial download, so you could see if they've added it to their latest and greatest :o)

Andrew
A: 

If you had a MouseEventHandler for the UltraGrid then you can do the following:

UltraGrid grid = (UltraGrid)sender;

UIElement element = grid.DisplayLayout.UIElement.ElementFromPoint(new Point(e.X, e.Y));

You can then cast the element depending on its expected type using element.GetContext():

 UltraGridCell cell = (UltraGridCell)element.GetContext(typeof(UltraGridCell));
Spear
+1  A: 

Check this out.

They don't convert the coordinates, but they use a special Infragistics grid event (MouseEnterElement) to get the element, which the mouse currently hovers over.

Maybe it helps.

Yacoder