ToolTip / rad TreeView integration

3 posts, 0 answers
  1. surfer
    surfer avatar
    585 posts
    Member since:
    Jul 2003

    Posted 24 Apr 2007 Link to this post

    Love the Prometheus approach, look very promising. And like very much the new term "ToolTipify" (and the tooltipify functionality).

    I have a quick question. I like to show a tooltip for each tree-node in the BeforeClientHighlight javascript event (since I do not wish to associate a new tooltip control for each node - I wish to only use one). So I'm trying something similar to:

    <script type="text/javascript">
           
            function ShowToolTip(node)
            {
                 var tooltip = $find("RadToolTip1");
                 var contentElement = tooltip.get_ContentElement();
                 tooltip.set_ContentElement(node.TextElement());
                 
                 tooltip.set_Text(node.Text);
                 
                 tooltip.show()
            }
           
            </script>
       
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
           
             <telerik:RadToolTip runat="server" ID="RadToolTip1"           
                    Position="TopRight"
                    ManualClose="true"
                    Width="300px"                                
                    TargetControlId="RadTreeView1" />
           
            <radT:RadTreeView ID="RadTreeView1" runat="server" BeforeClientHighlight="ShowToolTip">
                <Nodes>
                    <radT:RadTreeNode runat="server" Text="New Item">
                        <Nodes>
                            <radT:RadTreeNode runat="server" Text="New Item">
                            </radT:RadTreeNode>
                            <radT:RadTreeNode runat="server" Text="New Item">
                            </radT:RadTreeNode>
                            <radT:RadTreeNode runat="server" Text="New Item">
                            </radT:RadTreeNode>
                        </Nodes>
                    </radT:RadTreeNode>
                    <radT:RadTreeNode runat="server" Text="New Item">
                        <Nodes>
                            <radT:RadTreeNode runat="server" Text="New Item">
                            </radT:RadTreeNode>
                            <radT:RadTreeNode runat="server" Text="New Item">
                            </radT:RadTreeNode>
                            <radT:RadTreeNode runat="server" Text="New Item">
                            </radT:RadTreeNode>
                        </Nodes>
                    </radT:RadTreeNode>
                    <radT:RadTreeNode runat="server" Text="New Item">
                        <Nodes>
                            <radT:RadTreeNode runat="server" Text="New Item">
                            </radT:RadTreeNode>
                            <radT:RadTreeNode runat="server" Text="New Item">
                            </radT:RadTreeNode>
                            <radT:RadTreeNode runat="server" Text="New Item">
                            </radT:RadTreeNode>
                        </Nodes>
                    </radT:RadTreeNode>
                </Nodes>
               
            </radT:RadTreeView>


    However, I am getting a javascript error
    Microsoft JScript runtime error: 'this._contentCell' is null or not an object

    in the
    set_ContentElement method

    A second question - how can I create a tooltip without specifying
    TargetControlID (if I leave it blank I get another javascript error)
  2. surfer
    surfer avatar
    585 posts
    Member since:
    Jul 2003

    Posted 24 Apr 2007 Link to this post

    Oh, never mind. set_ContentElement is the Html of the tooltip template - no need to past node.TextElement() there.

    So it is working now, my next question is how do I check client-side if a ToolTip is already visible. There is no get_Visible property (or something similar) in the list of properties in the tooltip help.
  3. Petya
    Admin
    Petya avatar
    869 posts

    Posted 24 Apr 2007 Link to this post

    Hi,

    Client-side you should use the isVisible method of RadToolTip. For more information, please review the client-side API of RadToolTip.


    Best wishes,
    Petya
    the telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top