Hello
how is it possible to read cell value and display tooltip on mouse hover in a grid .
i tryed the
{
}
but it does not work
Casually, there is another post where they suggest to do the following:
//assuming you have a ToolTip control
void grid_MouseLeaveElement(object sender, Infragistics.Win.UIElementEventArgs e) { toolTip.SetToolTip(poolGrid, null); } void grid_MouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e) { if (e.Element is EditorButtonUIElement) { EditorButton button = e.Element.GetContext(typeof(EditorButton)) as EditorButton; if (button.Tag != null) toolTip.SetToolTip(grid, button.Tag.ToString()); } }
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. :)
Mike, using the MouseEnterElement and MouseLeaveElement approach, can one introduce a tool tip delay i.e. it takes some time before the tool tip shows? Would one just sleep for a few millisecond and then cause the tooltip to show?
Well, if you use the ShowToolTip method, then the tooltip will show up immediately.You could use a Timer to introduce a delay, I suppose.
Another option would be to change the ToolTip on the control based on the location of the mouse. You would do this using the UltraToolTipManager.GetUltraToolTip method. And then you can set properties on the UltraToolTip settings for that control. This way the UltraToolTipManager would handle the delay for you.
Mike,
Two questions regarding two unrelated requirements:
- I have a column with icons displayed representing some underlying values. I would like a tooltip on the icon to say what it means (eg: red dot - status trouble, green dot- status fine, etc) What is the best approach to do this? Is there a way to tell the tooltipmanager that I want tooltip for a complete grid column and tell it what the various tooltips are for each underlying values of icon?
- Unrelated to the above question, I have another requirement to show tooltip for each cell but with a delay. I found from previous posts that it is possible to set tooltip on individual cells using the tooltip property but it shows without delay. For getting the delay, based on your suggestion, I would need to use the ToolTipManager
a) what control would I associate the tooltipmanager with
b) To set the tooltip value, I have to trap the mouse enter event, find the underlying cell and set the tooltip value?
Thanks!