Is it possible to hide a tooltip from being displayed in just one of my columns?
Hi,
The TipStyleCell property is only on the Override and I can't find any property on the Column for this, so it looks like there's no really easy property for this. You should Submit a feature request to Infragistics.
In the mean time, you can do this with a CreationFilter. It would look something like this:
internal class ToolTipCreationFiter : IUIElementCreationFilter { #region IUIElementCreationFilter Members public void AfterCreateChildElements(UIElement parent) { CellUIElement cellUIElement = parent as CellUIElement; if (cellUIElement != null) { UltraGridCell cell = cellUIElement.GetContext(typeof(UltraGridCell)) as UltraGridCell; if (cell != null) { if (cell.Column.Key == "String 2") cellUIElement.ToolTipItem = null; } } } public bool BeforeCreateChildElements(UIElement parent) { return false; } #endregion }
At some point, like perhaps in the Form_Load, you just have to assign an instance of the CreationFilter to the grid:
this.ultraGrid1.CreationFilter = new ToolTipCreationFiter();
Thanks Mike. I just tried this and it does not seem to be working, although it makes sense. I have altered the code as follows to vb:
#Region "Creation Filter" Public Class ToolTipCreationFilter Implements IUIElementCreationFilter
Public Sub AfterCreateChildElements(ByVal parent As Infragistics.Win.UIElement) Implements Infragistics.Win.IUIElementCreationFilter.AfterCreateChildElements Dim cellUIElement As CellUIElement = TryCast(parent, CellUIElement) If Not cellUIElement Is Nothing Then Dim cell As UltraGridCell = DirectCast(cellUIElement.GetContext(GetType(UltraGridCell)), UltraGridCell) If Not cell Is Nothing Then If cell.Column.Key = ROW_NAME_AvailableList Then cellUIElement.ToolTipItem = Nothing End If End If End If End Sub
Public Function BeforeCreateChildElements(ByVal parent As Infragistics.Win.UIElement) As Boolean Implements Infragistics.Win.IUIElementCreationFilter.BeforeCreateChildElements Return False End Function End Class#End Region
Sorry man, I forgot I turned off the grid's internal tooltip because I couldn't set the display time for it and there was also a bug I found and reported for it which cut off part of the tooltip display. I use the UltraToolTip control now. Thanks for mentioning that an external tooltip might be in use.
You have been very helpful to me over the past couple years, I really appreciate it.
DK
Hm, that's really odd. It worked fine for me when I tested it. I can't see how VB would make any difference here.
Can you try this in a small sample project and see if it works there?
Is it possible your application is showing a tooltip externally to the grid?
I changed the code so it manipulated the background color just to try to isolate the problem. The filter does get applied and the background color is changing according to the creation filter. So the issue is directly related to the tooltip.
yup, I assign it in my controller, and I did check if the code execution falls into the line you mentioned and it does. That is why I am a little puzzled as to why I am not seeing the expected results.
This looks like it should work. I assume you are assigning the grid's CreationFilter property to an instance of this class?
Have you tried putting breakpoints into this code to see if the "ToolTipItem = Nothing" line is ever getting hit?