Is there a way on the ultragrid (or wingrid) to set the tooltip width so that it only fits to the width of the column that is being hovered over? Currently it expands to the entire screen and I have some users who were wondering if this could be altered.
Any examples are certainly appreciated (C#).
Thanks!
Our ToolTipInfo struct, which the grid uses to display the cell tooltips, exposes a 'MaxWidth' property, which allows you to restrict the width, but not force it any bigger. You could use this mechanism to prevent the tooltip width from getting any larger than the width of the column, but you would not be able to force it to that with when there is not enough text in the tooltip.
There is no publicly exposed property or event that gives you access to this struct, but I think you might be able to work around that. The UIElement class exposes a settable property, ToolTipItem, which is of type Infragistics.Win.IToolTipItem, so you could use the IUIElementCreationFilter interface (handle the AfterCreateChildElements method) to intercept the initialization of these elements, and then set the ToolTipItem property of the CellUIElements to a class that implements the IToolTipItem interface. That interface only exposes one method, GetToolTipInfo, which passes you a reference to the CellUIElement, and a ToolTipInfo struct.
You may have arrived at the conclusion by now that this is too much work for the requirement, so you might alternatively want to submit a feature request for a property that allows you to control this.
It doesn't sound like too much work, it just sounds a little out of my league right now. I understand the concepts, but I'm afraid how to apply all of this.
I didn't see AfterCreateChildElements as part of the WinGrid or Ultragrid events, so I assume it's an event of the ToolTipItem?
I don't expect you to do the work for me, but any further direction you can give is certainly appreciated.