Create RadPane's Menu Dynamically

2 posts, 0 answers
  1. Iter
    Iter avatar
    1 posts
    Member since:
    Jul 2010

    Posted 05 Aug 2010 Link to this post

    RadPanel am creating dynamically and also need to add the ContextMenuTemplate the same as it would be this code via code behind in c #. Net?

            <telerik:RadContextMenu Loaded="RadContextMenu_Loaded">
                <telerik:RadMenuItem Header="item" />

    I thank you

  2. Konstantina
    Konstantina avatar
    2332 posts

    Posted 10 Aug 2010 Link to this post

    Hi Iter,

    Thank you for contacting us.

    To achieve your goal you can move the DataTemplate into the Resources. Then, you have to put a x:Key name of the DataTemplate and to set it to the Pane in code-behind, you can use the following line:
    pane.ContextMenuTemplate = this.Resources["MyDataTemplate"] as DataTemplate;

    Hope this helps. If you need further assistance please feel free to contact us again.

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top