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

Keep the ContextMenu open after MenuItem has been clicked?

3 Answers 173 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Thomas Roithmeier
Top achievements
Rank 1
Thomas Roithmeier asked on 24 Oct 2010, 07:13 AM
I've adapted the ContextMenu sample from the sample application where you can set the Visibility for each Column of a RadGridView for my application.
Now it would be nice if the ContextMenu stays open and the user can set the Visiblity of all columns without having to right-click on the header for each single column he wants to show or hide and if the ContextMenu closes when you click outside of it.

Is there a way to do that with RadContextMenu?

Thx

3 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 25 Oct 2010, 07:52 AM
Hi Thomas Roithmeier,

RadMenuItem have StaysOpen property. If you set it to true then menuItem will keep the menu open (unless you click outside the menu). You can set it to all items that have to keep the menu open or you can use implicit style (without x:Key) and set it in the style so that it will apply to all menu items.
Here is a simple example:
<telerik:RadContextMenu>
   <telerik:RadMenuItem Header="Stays Open" StaysOpenOnClick="True" />
   <telerik:RadMenuItem Header="Close On Click" />
   <telerik:RadMenuItem Header="Stays Open" StaysOpenOnClick="True" />
</telerik:RadContextMenu>

Let us know if you need more information.

Regards,
Hristo
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
0
Maximilian
Top achievements
Rank 1
answered on 27 Jan 2016, 10:34 AM

Hello,

though this post is quite old I hope to get help. Basically I want to do the same as the OP. I've tried to keep my RadContextMenu of one of my RadRibbonSplitButtons open so that the user can check several RadMenuItems at once without having to open the menu each time. I tried to achieve this by setting the RadContextMenu's StaysOpen property to True, by setting the StaysOpenOnClick property of the respective RadMenuItems to True and by setting the RadRibbonSplitButton's KeepOpen property to True. However, neither of those did work... Can you please help me?

Here's my XAML:

<telerik:RadRibbonSplitButton Size="Large"
                              Text="Start/Stop"
                              LargeImage="../Images/SceneStartStopp32.png"
                              SmallImage="../Images/SceneStartStopp16.png">
    <telerik:RadRibbonSplitButton.DropDownContent>
        <telerik:RadContextMenu StaysOpen="True">
            <telerik:RadMenuGroupItem Header="Start- und Stopverhalten">
                <telerik:RadMenuItem Name="MenuItemDoNotStop"
                                     IsCheckable="True"
                                     IsChecked="False"
                                     Header="Nicht stoppen"
                                     Checked="RadMenuItem_OnChecked"/>
                <telerik:RadMenuItem Name="MenuItemStartStopSimultaneously"
                                     IsCheckable="True"
                                     IsChecked="True"
                                     Header="Start und Stop gleichzeitig"
                                     Checked="RadMenuItem_OnChecked"/>
                <telerik:RadMenuItem Name="MenuItemFirstStartThenStop"
                                     IsCheckable="True"
                                     IsChecked="False"
                                     Header="Erst Start, dann Stop"
                                     Checked="RadMenuItem_OnChecked"/>
            </telerik:RadMenuGroupItem>
            <telerik:RadMenuGroupItem Header="Vor- und Nachlaufzeit">
                <telerik:RadMenuItem Name="MenuItemStartWithLeadTime"
                                     IsCheckable="True"
                                     IsChecked="False">
                    <telerik:RadMenuItem.Header>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Grid.Column="0"
                                       Text="Start mit Vorlaufzeit"
                                       VerticalAlignment="Center"
                                       Margin="0,0,10,0"/>
                            <telerik:RadNumericUpDown Grid.Column="1">
                            </telerik:RadNumericUpDown>
                        </Grid>
                    </telerik:RadMenuItem.Header>
                </telerik:RadMenuItem>
            </telerik:RadMenuGroupItem>
        </telerik:RadContextMenu>
    </telerik:RadRibbonSplitButton.DropDownContent>
</telerik:RadRibbonSplitButton>

0
Polya
Telerik team
answered on 01 Feb 2016, 09:44 AM
Hello Maximilian,

This behavior is caused by the built in auto-closing popup mechanism of the RadRibonSplitButton which cannot be disabled.
That said, we suggest using the RadSplitButton instead which doesn't have the mentioned above behavior and will allow for the RadContextMenu to stay open when the StaysOpenOnClick = "true".

Hope this helps.

Regards,
Polya
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
ContextMenu
Asked by
Thomas Roithmeier
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Maximilian
Top achievements
Rank 1
Polya
Telerik team
Share this question
or