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

Strange behavior of context menu

1 Answer 97 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Xaria D
Top achievements
Rank 1
Xaria D asked on 18 Aug 2010, 07:04 AM
I have a context menu as Window.Resource with x:Shared set to true.
Now I have two Rad Panes whose context menu is set to this resource.
When I right click on the pane and if only one of the two panes is open the ContextMenu does not display.
only when both panes are open the contextmenu is shown.
Is this is a bug?

1 Answer, 1 is accepted

Sort by
0
Accepted
Kaloyan
Telerik team
answered on 19 Aug 2010, 12:02 PM
Hi Xaria D,

Please avoid setting a context menu to a RadPane as the RadDocking is setting an internal one that is displayed above the header containing the MenuCommands. The recommended approach is to set a ContextMenu to an element inside of the RadPane - for instance a grid. Check the following code and let us know if this is not helping you.

<Window.Resources>
       <telerik:RadContextMenu x:Key="contextMenu" x:Shared="true">
           <telerik:RadMenuItem Header="Item 1" />
           <telerik:RadMenuItem Header="Item 2" />
           <telerik:RadMenuItem Header="Item 3" />
           <telerik:RadMenuItem Header="Item 4" />
       </telerik:RadContextMenu>
   </Window.Resources>
   <Grid>
       <telerik:RadDocking>
           <telerik:RadSplitContainer>
               <telerik:RadPaneGroup>
                   <telerik:RadPane Header="Pane 1" Title="Pane 1">
                       <Grid Background="Transparent"
                               telerik:RadContextMenu.ContextMenu="{StaticResource contextMenu}" />
                   </telerik:RadPane>
               </telerik:RadPaneGroup>
               <telerik:RadPaneGroup>
                   <telerik:RadPane Header="Pane 2" Title="Pane 2">
                       <Grid Background="Transparent"
                               telerik:RadContextMenu.ContextMenu="{StaticResource contextMenu}" />
                   </telerik:RadPane>
               </telerik:RadPaneGroup>
           </telerik:RadSplitContainer>
       </telerik:RadDocking>
   </Grid>

All the best,
Kaloyan
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
ContextMenu
Asked by
Xaria D
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or