This is a migrated thread and some comments may be shown as answers.

radtooltip for each treeview node

2 Answers 154 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Pranjal
Top achievements
Rank 1
Pranjal asked on 06 May 2008, 05:51 AM
Hello,

How can i show a radtooltip for each node of radtreeview on mouseover and position it beside the node. i am using rad controls prometheus. i also want to fetch some records from the database as tooltip content. please advice me asap.

thanks & regards
Pranjal

2 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 09 May 2008, 02:20 PM
Hi Pranjal,

I prepared a sample project which demonstrates the desired functionality. Please, note that you should add an ID attribute to the RadTreeView nodes because they do not have an ID on the client.

Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Aarsh
Top achievements
Rank 1
answered on 23 Sep 2012, 09:50 PM
You can do this either of the following ways:

1)
If you wish to use the default tool-tip of your windows theme, you can use the following line of code in the code behind just before you add the node,

usersNode,ToolTip = strUSerName + (" + intUserID.ToString() + ")" ;
mainUserNode.Nodes.Add(usersNode);


2)

Or, you can use the RadToolTipManager Control provided by Telerik.
In this case, following is one of the possible implementations

<telerik:RadTreeView ID="MainTree" runat="server" Skin="WebBlue" BackColor="white" EnableDragAndDrop="false" EnableDragAndDropBetweenNodes="false" Height="100%" OnLoad="LoadMainTree" Visible="true" OnContextMenuItemClick="ContextMenuItemClick">
</telerik:RadTreeView>
<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" OnAjaxUpdate="RadToolTipManager_AjaxUpdate" Skin="Sunset">
</telerik:RadToolTipManager>

RadToolTipManager_AjaxUpdate may have following implementation in the code behind:

internal static void RadToolTipManager_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
{
    System.Web.UI.WebControls.Label lblTitle = new System.Web.UI.WebControls.Label();
    lblTitle.Text = "Title";
    lblTitle.Attributes.Add("style", "font-weight: 700");
    System.Web.UI.WebControls.Label lblCaption = new System.Web.UI.WebControls.Label();
    lblCaption.Text = "\nThis is the demomnstration text for the Telerik Tool Tip manager.";

     // you can access the ID of the tree using e.TargetControlID - just in the case you need it.
 
    e.UpdatePanel.ContentTemplateContainer.Controls.Add(lblTitle);
    e.UpdatePanel.ContentTemplateContainer.Controls.Add(lblCaption);
}

finally, the LoadTree Event handler ...

private void LoadTree()
        {
        RadToolTipManager1.ShowDelay = 100;
        RadToolTipManager1.HideDelay = 100;
        RadToolTipManager1.AutoCloseDelay = 8000;
        RadToolTipManager1.TargetControls.Add("MainTree");
        }


Hope this will get you started...

Thanks,
-Aarsh
Tags
ToolTip
Asked by
Pranjal
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Aarsh
Top achievements
Rank 1
Share this question
or