ContextMenu on RadMenuItem

2 posts, 0 answers
  1. Development
    Development avatar
    7 posts
    Member since:
    Dec 2010

    Posted 13 Jan 2011 Link to this post

    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!
  2. Pana
    Admin
    Pana avatar
    748 posts

    Posted 19 Jan 2011 Link to this post

    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>>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top