hi,
I'm trying to show tooltip in ultratree for cell value that's clipped but it doesn't seem to work. In
UltraTree1.MouseEnterElement, i check if the element is fully visible and it always return True even the item is clipped. Here's sample code:
Private _nameColumn As UltraTreeNodeColumn = Nothing
Private _valueColumn As UltraTreeNodeColumn = Nothing
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
With UltraTree1
.DisplayStyle = UltraTreeDisplayStyle.WindowsVista
.ViewStyle = ViewStyle.OutlookExpress
With .ColumnSettings
.AutoFitColumns = AutoFitColumns.ResizeAllColumns
End With
Dim rootColumnSet As UltraTreeColumnSet = UltraTree1.ColumnSettings.RootColumnSet
_nameColumn = rootColumnSet.Columns.Add("Name")
_valueColumn = rootColumnSet.Columns.Add("Value")
With _nameColumn
.DataType = GetType(String)
.LayoutInfo.PreferredCellSize = New Size(CInt(Me.Width / 2), 0)
With _valueColumn
.DataType = GetType(Object)
Dim root As UltraTreeNode = Me.UltraTree1.Nodes.Add("root level 1")
root.SetCellValue(_nameColumn, 1)
root.SetCellValue(_valueColumn, "The Editor property can be set to any of the editors provided by the Win assembly, as the EditorControl property can be set to any of the controls in the UltraWinEditors assembly.")
Dim child As UltraTreeNode = root.Nodes.Add("child level 1")
child.SetCellValue(_nameColumn, 2)
child.SetCellValue(_valueColumn, "short message")
UltraTree1.ExpandAll()
Private Sub UltraTree1_MouseEnterElement(ByVal sender As Object, ByVal e As Infragistics.Win.UIElementEventArgs) Handles UltraTree1.MouseEnterElement
Dim pt As New Point(e.Element.Rect.X, e.Element.Rect.Y)
Dim node As Infragistics.Win.UltraWinTree.UltraTreeNode = UltraTree1.GetNodeFromPoint(pt)
If node Is Nothing Then
UltraToolTipManager1.HideToolTip()
Return
End If
Dim nValue As Object = node.Cells(_valueColumn).Value
If nValue Is Nothing Then
If String.IsNullOrEmpty(nValue.ToString) Then
If e.Element.IsFullyVisible = True Then
Try
Dim tipInfo As New Infragistics.Win.UltraWinToolTip.UltraToolTipInfo( _
nValue.ToString, _
Infragistics.Win.ToolTipImage.Default, "", _
Infragistics.Win.DefaultableBoolean.True)
UltraToolTipManager1.SetUltraToolTip(UltraTree1, tipInfo)
UltraToolTipManager1.ShowToolTip(UltraTree1)
Catch ex As Exception
End Try
End Sub
IsFullyVisible only tells you whether the element's ClipRect is smaller than the element's Rect. It is not really useful for your purposes here. You might have better luck with something like the following:
Example:private void ultraTree1_MouseEnterElement(object sender, UIElementEventArgs e){ EditorWithTextUIElement element = e.Element as EditorWithTextUIElement; if ( element != null && element.IsDataFullyVisible == false ) { // Show tooltip }}
above soltion It is not working.
I am using Infragistics.Win.TextTrimming.EllipsisCharacter for the node text.
I would like to know whether text is fully visible or not.
thanks in advance