Hi
I have a UltraGrid that contains a URL column. I formatted this column WITHOUT UNDERLINE feature.
I did this with the following code: drawParams.AppearanceData.FontData.Underline = DefaultableBoolean.Default;, on DrawPhase IUIElementDrawFilter.GetPhasesToFilter(ref UIElementDrawParams drawParams) event.
However, when I put the mouse cursor in a cell of this column, I want to show the text UNDERLINED.
When I use DataGridView, I can do it with this code:
DataGridView1.LinkBehavior = LinkBehavior.HoverUnderline;
*This code automatically do what I want (to show the text of cell (underlined) just when the mouse cursor is hover).
Thanks
Mike, thanks a lot.
It's working now.
Hi,
It looks like you are using a DrawFilter for this. So what you would have to do is change your DrawFilter to apply an underline or not based on whether or not the mouse is inside the element.
The easiest way to do this would be to get the grid's main UIElement from the element you are drawing and then check LastElementEntered. If it's the same element you are drawing, then you know the mouse is inside the element.
Something like this:
if (drawParams.Element.ControlElement.LastElementEntered == drawParams.Element)