tooltips for radtreeview context menus

2 posts, 0 answers
  1. steve matheson
    steve matheson avatar
    28 posts
    Member since:
    Jul 2005

    Posted 16 Jun 2009 Link to this post

     

    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

  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 18 Jun 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top