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

Create RadPane's Menu Dynamically

1 Answer 65 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Iter
Top achievements
Rank 1
Iter asked on 06 Aug 2010, 01:14 AM

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:RadPane.ContextMenuTemplate>
    <DataTemplate>
        <telerik:RadContextMenu Loaded="RadContextMenu_Loaded">
            <telerik:RadMenuItem Header="item" />
        </telerik:RadContextMenu>
    </DataTemplate>
</telerik:RadPane.ContextMenuTemplate>

I thank you

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 10 Aug 2010, 03:07 PM
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,
Konstantina
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
Tags
Docking
Asked by
Iter
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or