Arrow Icon (when have sub context menu)

2 posts, 0 answers
  1. ruty
    ruty avatar
    42 posts
    Member since:
    Mar 2009

    Posted 14 May 2009 Link to this post


    Hi,
    I have a context menu, in run time I added to first item in the context menu -   Sub Context menu.(dynamicly)
    the sub context menu created dynamicly when the user press on the first item in the context menu.

    I want that on the first item in the context menu showen arrow icon always(though that the sub context menu created dinamicly later) ,in order to the user know that have sub context menu to the item.
    I try to create sub context menu demo when the context menu create, the icon was show , but the event of the first item in the context menu be lost.
    How can I do it???(to show the arrow icon always)
    Thanks.
  2. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 15 May 2009 Link to this post

    Hello ruty,

    We don't have such a property, but I found a workaround for you. You have to set the same template as the one we use for menu items having children. This is done like this:
            void item1_Loaded(object sender, RoutedEventArgs e) 
            { 
                var menuItem = sender as RadMenuItem; 
                menuItem.SubmenuItemTemplateKey = menuItem.SubmenuHeaderTemplateKey; 
                menuItem.Template = menuItem.SubmenuHeaderTemplateKey; 
                menuItem.ApplyTemplate(); 
            } 

     I have attached a simple project which shows how it is done. If you need more help I will be glad to help you further.

    Regards,
    Boyan
    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. DevCraft banner
Back to Top