HTML in Radmenu item tooltip?

3 posts, 0 answers
  1. David
    David avatar
    10 posts
    Member since:
    Sep 2010

    Posted 23 Jul 2012 Link to this post

    Is this possible without javascript / radtooltipmanager? We would like to have things like "<strong>Tool Tip</strong> Text" display for items in a radmenu. The same text is loaded as a tooltip for text (links) to be highlighted in a literal on the page, and is tooltipified using a RadToolTipManager. In the main text, the HTML display is fine for the tooltip, but in the menu item, it all displays as plain text. The tooltipmanager has no Target Controls, just trying to have everything on the page present the same way but the menu items don't seem to be picked up.

    Menu item text and tool tip text are both loaded from a SQL data source depending on other page selections, not hard coded into the radmenu control. It appears a blank tool tip is trying to come from the tooltipmanager on each radmenu item, but the non-tooltipified tool tip pops up with no skin formatting.

    I have also tried a separate RadToolTip control just for the RadMenu control but no luck. Is there a TargetControlID such as MyMenu_Items that I should be using?

    Thanks
    Dave
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 26 Jul 2012 Link to this post

    Hello Dave,

    Here is one possible solution:
    <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" AutoTooltipify="true">
       </telerik:RadToolTipManager>
       <telerik:RadMenu ID="RadMenu1" runat="server">
           <Items>
               <telerik:RadMenuItem runat="server" Text="Root RadMenuItem1" ToolTip="Root RadMenuItem1">
                   <Items>
                       <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 1" ToolTip="Child RadMenuItem 1">
                       </telerik:RadMenuItem>
                       <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 2" ToolTip="Child RadMenuItem 2">
                       </telerik:RadMenuItem>
                   </Items>
               </telerik:RadMenuItem>
               <telerik:RadMenuItem runat="server" Text="Root RadMenuItem2" ToolTip="Root RadMenuItem2">
                   <Items>
                       <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 1" ToolTip="Child RadMenuItem 1">
                       </telerik:RadMenuItem>
                       <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 2" ToolTip="Child RadMenuItem 2">
                       </telerik:RadMenuItem>
                   </Items>
               </telerik:RadMenuItem>
               <telerik:RadMenuItem runat="server" Text="Root RadMenuItem3" ToolTip="Root RadMenuItem3">
               </telerik:RadMenuItem>
           </Items>
       </telerik:RadMenu>

    code-behind:
    //If your RadMenu is databound, you can handle ItemDataBound to do the same:
       protected void Page_Load(object sender, EventArgs e)
       {
           foreach (RadMenuItem item in RadMenu1.GetAllItems())
           {
               item.ToolTip = "<strong>" + item.ToolTip + "</strong>";
           }
       }


    Greetings,
    Peter
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David
    David avatar
    10 posts
    Member since:
    Sep 2010

    Posted 26 Jul 2012 Link to this post

    Thanks. Not quite what I was looking for but when is it ever the case that answers align perfectly with expectations?  :)
Back to Top