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

tooltips for radtreeview context menus

1 Answer 90 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
steve matheson
Top achievements
Rank 2
steve matheson asked on 16 Jun 2009, 06:03 AM

 

I am using the Q1-2009 radtreeview to create a databound menu tree with dynamically assigned contextmenus based on specifc node criteria.
I'm trying to use tooltip manager to create a tooltip panel when a particular context item is clicked and use it to load a specifc user control.
I've tried to attach a context menu item to the tooltip manager after it has been created using:
(working in VB)

Dim Contextmenu1 As New RadTreeViewContextMenu()
        Contextmenu1.ID = "Contextmenu1"
     
  Dim MenuItem1 As New RadMenuItem()
        MenuItem1.Text = "Menu Item 1"
        MenuItem1.Value = "menuitemvalue"
        MenuItem1.ToolTip = "Menu Item 1 Tooltip"
        Contextmenu1.Items.Add(menuitem1)

        RadToolTipManager1.TargetControls.Add(menuitem1.clientID, "menuitemvalue", True)

But that does not seem to work. I've also tried adding the new target control after the contextmenu has been added to the tree node
as here:

node.ContextMenuID = "Contextmenu1"
  Dim menu1 As Telerik.Web.UI.RadTreeViewContextMenu = New Telerik.Web.UI.RadTreeViewContextMenu
                menu1 = CType(RadTreeView1.FindControl("Contextmenu1"), Telerik.Web.UI.RadTreeViewContextMenu)
                menu1.Items(0).Text = menu1.Items(0).ClientID
                RadToolTipManager1.TargetControls.Add(menu1.Items(0).ClientID, "menuitemvalue", True)

but this doesn't seem to work either.
I'm not sure if this is the wrong technique or if I'm just using it in the wrong way.
Any suggestions would be greatly appreciated.
Thanks

steve matheson

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 18 Jun 2009, 01:40 PM
Hello Steve,

The approaches you have tried are correct when the tooltipified elements have ClientIDs. However, this is not the case with the context menu of the RadTreeView and that is why your code did not work as expected. In order to get the desired result you can either create the tooltip on the client or add an ID attribute on the server. Both approaches are demonstrated in the following demos:

http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipcalendar/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltiptreeview/defaultcs.aspx

You should use the same logic but implement it for the context menu items instead of treeview nodes or calendar days.

Sincerely yours,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
ToolTip
Asked by
steve matheson
Top achievements
Rank 2
Answers by
Svetlina Anati
Telerik team
Share this question
or