Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
display tooltip on mouse hover in cell
posted

Hello

how is it possible to read cell value and display tooltip on mouse hover in a grid .

i tryed the

Point mousePoint = new Point(MousePosition.X, MousePosition.Y);

UIElement element = ultraGrid1.DisplayLayout.UIElement.ElementFromPoint(mousePoint);

UltraGridCell cell = element.GetContext(typeof(UltraGridCell)) as UltraGridCell;

 

if (cell != null)

{

MessageBox.Show(cell.Row.Index.ToString() + " " + cell.Column.Key);

}

 

but it does not work

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    My guess is that MousePosition returns you the position of the mouse in screen coordinates, not control coordinates. You can probably convert the coords using grid.PointToClient. Or you can use the MouseMove even and use e.X and e.Y. 

    Or, you could use grid.DisplayLayout.UIElement.LastElementEntered, instead of ElementFromPoint.

    Or, you could use MouseEnterElement and MouseLeaveElement, as suggested above. :)

Children