Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET and ASP.NET AJAX > Menu > RadMenu IsContext="True" display box around menu Items and left image

Not answered RadMenu IsContext="True" display box around menu Items and left image

Feed from this thread
  • Daniel avatar

    Posted on Oct 7, 2008 (permalink)

    I have used examples to create a RadMenu ContextMenu. I'm able to get it to work but I can't get the box to display around the menu items like it does in the example unless I let it default. I would like to have a border around the context menu like the example has in the following link and add icons to the left of the menu item.
    http://demos.telerik.com/aspnet/Controls/Examples/Integration/GridAndMenu/DefaultCS.aspx

    In the .ascx page I have

    <%

    @ Register TagPrefix="radm" Namespace="Telerik.WebControls" Assembly="RadMenu.NET2" %>

     

     

    <radm:RadMenu ID="RadMenu1" 
        IsContext="True" 
        runat="server" 
        Skin="Outlook"
        OnItemClick="grInvoiceDetailItems_ItemClick"     
        ContextMenuElementID
    ="contextElement">
        <Items>
            <radm:RadMenuItem Text="WriteOff" />
            <radm:RadMenuItem Text="Include In Settlement" />
            <radm:RadMenuItem Text="Refund" />
        </Items>
    </radm:RadMenu>

     


    I have placed the Menu.Outlook.css 'C:\Program Files\Telerik\RadControls for ASPNET AJAX Q2 2008\Skins\Outlook\Menu.Outlook.css' in my project and the images in the project but it is not putting a box around the items.

    What do I need to check or do to get the box displaying around the context menu item?

    What do I need to do to get an image beside my menu items?

    Thank you

    Reply

  • Daniel avatar

    Posted on Oct 7, 2008 (permalink)

    I forgot that I have this code too but it is in the example link above:

    <

     

    script type="text/javascript">
    function RowContextMenu(index, e)
    {
        document.getElementById("radGridClickedRowIndex").value = index;
        var menu = <%= RadMenu1.ClientID %>;
        menu.Show(e);
        e.cancelBubble = true;
        e.returnValue = false;

     

        if (e.stopPropagation)
        {
            e.stopPropagation();    
            e.preventDefault();
        }

        this.SelectRow(this.Rows[index].Control, true);
    }

    </script>

    I played with adding the image to the left and it can be done like:

     

    <

     

    radm:RadMenu ID="RadMenu1" 
        IsContext="True" 
        runat="server" 
        OnItemClick="grInvoiceDetailItems_ItemClick" 
        ContextMenuElementID
    ="contextElement">
        <Items>
            <
    radm:RadMenuItem Text="WriteOff" ImageUrl="~/Images/docIcon.gif" />
            <radm:RadMenuItem Text="Include In Settlement" />
            <radm:RadMenuItem Text="Refund" />
        </Items>
    </radm:RadMenu>

     

    If you pick the image using the ImageUrl it will error if the '../../Images/docIcon.gif' is used so it must be the '~' root indicator to navigate with.

     

    Reply

  • Yana Yana admin's avatar

    Posted on Oct 9, 2008 (permalink)

    Hi Daniel,

    You are using RadMenu for ASP.NET, but the skin is for RadMenu for ASP.NET AJAX according to the path you've mentioned. Please check the attached simple project which shows the menu with the right Outlook skin, just right click anywhere on the page to see it.

    Regards,
    Yana
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Code Library / ASP.NET and ASP.NET AJAX > Menu > RadMenu IsContext="True" display box around menu Items and left image