I am using ultratooltipInfo and manager for my grids using the code listed below. My question is "Does the ultratooltipinfo object automatically get disposed? A new tooltipInfo Object gets set in the manager for my grid over and over, but I never explicitly remove the old object. I saw in documentation it said the SetToolTip method will replace any existing tooltipInfo object that is tied to the control with the new one. Does this mean the old object gets destroyed, whether it be explicity destroyed by Infragistics code or VS garbage collection? Or will they build up possibly causing memory issues?
Dim acell As UltraGridCell = CType(e.Element.GetContext(GetType(Infragistics.Win.UltraWinGrid.UltraGridCell)), UltraGridCell)
If Not acell Is Nothing AndAlso Not acell.Value.ToString = "" Then
If acell.ToolTipText Is Nothing Then
Else
End If
Me.UltraToolTipManager1.DisplayStyle = ToolTipDisplayStyle.Standard
Me.UltraToolTipManager1.AutoPopDelay = 30000
End Sub
UltraToolTipManager1.HideToolTip()
Thanks in advance
Dave K.
Hi Dave,
I tool a look and while UltraToolTipInfo is disposable, there's actually nothing on it that needs disposing. It is only disposable because it derives from SubObjectBase, but it doesn't override OnDispose and calling the Dispose method won't actually do anything anyway.
The only way this object might cause a problem is because of event hooks, but any event hooks are removed when you call SetUltraToolTip and the old ToolTipInfo is removed.
Having said that, it seems to me that it would be more efficient to use GetUltraToolTip, instead, and then just set properties on the existing tooltip, rather than creating a new one every time.