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

ContextMenu on RadMenuItem

1 Answer 112 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Development
Top achievements
Rank 1
Development asked on 13 Jan 2011, 12:27 PM

We're using a customized RadDocking, having a RadSplitContainer > RadPaneGroup which is having TabStripPlacement="Top". The ContextMenu always shows the Header of the RadPane's (inside the RadPaneGroup) to select/activate them, any approch to customize the ContextMenu (e.g. add Custom Command) fails.

Here some core code:

<telerik:RadDocking >
    <telerik:RadSplitContainer InitialPosition="DockedTop">
        <telerik:RadPaneGroup TabStripPlacement="Top">
            <telerik:RadPane Header="Pane 1" IsSelected="True" />
            <telerik:RadPane Header="Pane 2"/>
        </telerik:RadPaneGroup>
    </telerik:RadSplitContainer>
</telerik:RadDocking>

Here some code from the style:

<Style TargetType="{x:Type telerik:RadPaneGroup}">
    <Setter Property="TopTemplate">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type telerik:RadPaneGroup}">
                <Grid>
                ...
                <ToggleButton x:Name="DropDownButtonElement" Grid.Column="4" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Visibility="Hidden">
                    <telerik:RadContextMenu.ContextMenu>
                        <Telerik_Windows_Controls_TabControl:DropDownMenu x:Name="DropDownMenuElement" ClickToOpen="True" DisplayMemberPath="{TemplateBinding DropDownDisplayMemberPath}" ItemTemplate="{TemplateBinding ItemDropDownContentTemplate}" Placement="Bottom" Style="{TemplateBinding DropDownStyle}" StaysOpen="False"></Telerik_Windows_Controls_TabControl:DropDownMenu>
                    </telerik:RadContextMenu.ContextMenu>
                    ...

How to change the part (think it should be inside <telerik:RadContextMenu.ContextMenu>) to get it working?

Many Thanx!

1 Answer, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 19 Jan 2011, 07:34 AM
Hello,

There is a ContextMenuTemplate property on the RadPane which can customize. You can see in the attached example how the DataTemlpate with menu inside is defined and applied on the second RadPane. You can set it pretty much the same way on first and reuse the menu template.

I hope the attached project will help you.


Best wishes,
Pana
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
ContextMenu
Asked by
Development
Top achievements
Rank 1
Answers by
Pana
Telerik team
Share this question
or