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

Arrow Icon (when have sub context menu)

1 Answer 95 Views
Menu
This is a migrated thread and some comments may be shown as answers.
ruty
Top achievements
Rank 1
ruty asked on 14 May 2009, 05:56 AM

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.

1 Answer, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 15 May 2009, 02:15 PM
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.
Tags
Menu
Asked by
ruty
Top achievements
Rank 1
Answers by
Boyan
Telerik team
Share this question
or