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
145
UltraWinGrid URL Column Appearance
posted

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

Parents
  • 469350
    Verified Answer
    Offline posted

    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)

Reply Children
No Data