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

Show hotkeys in RadMenuItem

13 Answers 328 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Anton
Top achievements
Rank 2
Anton asked on 12 Jul 2012, 11:27 AM

How to show hotkey in right part of menu item for RadMenuItem? Or how to add MenuItem to RadContextMenu? MenuItem wraps into RadMenuItem and looks ugly (I don't want to change HeaderTemplate because I think RadContextMenu should have better functionality than free analogs):

<t:RadContextMenu>    
   
<t:RadContextMenu.Items>
       
<MenuItem Header="Copy" Command="Copy" />
       
<t:RadMenuItem Header="Copy" Command="Copy" />
   
</t:RadContextMenu.Items>
</t:RadContextMenu>

enter image description here

13 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 17 Jul 2012, 02:29 PM
Hello,

RadMenu is designed to work with RadMenuItem not with MenuItem, so please try to use only RadMenuItem.

For your problem - this is a known issue and you can vote for implementing it on our PITS system: http://www.telerik.com/support/pits.aspx#/details/Issue=2143 Anyway we have implemented a workaround for your case. Please find it below and check the attachment how it will look like:
<Window x:Class="WPF_RadMenu_hotkeys.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Grid Background="Wheat">
        <t:RadContextMenu.ContextMenu>
            <t:RadContextMenu Grid.IsSharedSizeScope="True">
                <t:RadContextMenu.Items>
                    <!--<MenuItem Header="Copy" InputGestureText="Ctrl + F" />-->
                    <t:RadMenuItem HorizontalContentAlignment="Stretch">
                        <t:RadMenuItem.Header>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" SharedSizeGroup="AccessKey" />
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="Copy" />
                                <TextBlock Margin="8 0" Grid.Column="1" Text="Ctrl + C" Foreground="Gray" />
                            </Grid>
                        </t:RadMenuItem.Header>
                    </t:RadMenuItem>
                    <t:RadMenuItem HorizontalContentAlignment="Stretch">
                        <t:RadMenuItem.Header>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" SharedSizeGroup="AccessKey" />
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="Paste Special" />
                                <TextBlock Margin="8 0" Grid.Column="1" Text="Ctrl + Shift + V" Foreground="Gray" />
                            </Grid>
                        </t:RadMenuItem.Header>
                    </t:RadMenuItem>
                </t:RadContextMenu.Items>
            </t:RadContextMenu>
        </t:RadContextMenu.ContextMenu>
    </Grid>
</Window>

Please inform me if this helps you and for any concerns you have.

Regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Ralf
Top achievements
Rank 1
answered on 13 Sep 2012, 11:03 AM
Hi,

We need a fully implemented context menu including all functions of the standard menu. That includes automatically using the Coammnd name (ApplicationsCommands.Copy.Name), the short cuts and enabling/disabling.

Will this be possible?

Regards,
Ralf
0
Rosen Vladimirov
Telerik team
answered on 14 Sep 2012, 10:52 AM
Hello Ralf,

At the moment RadContextMenu does not support the required functionality.  We understand that this is a common requirement and will raise its priority. However, as the Q3 is approaching, we cannot commit to a certain timeframe for implementing this.
 
Thank you for the understanding and sorry for the caused inconvenience.

Regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Kristoffer
Top achievements
Rank 1
answered on 10 Dec 2012, 03:17 PM
This is a must-have feature! Can you please promise this for Q1 2013?
0
Rosen Vladimirov
Telerik team
answered on 11 Dec 2012, 07:47 AM
Hi Kristoffer,

We are aware of the importance of these features, but I cannot give you exact timeframe when they will be implemented.

We are sorry for the caused inconvenience.

Kind regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rosen Vladimirov
Telerik team
answered on 11 Dec 2012, 09:22 AM
Hi Kristoffer,

Just to clear the things - in WPF there's pretty easy way to do this - as shown in the code below you can use SharedSizeGroup. The problem is in Silverlight where there isn't a valid workaround as SharedSizeGroup doesn't exist in the framework. So if you want to use WPF you can take a look at the code below - this should do the job for you:
<Grid Background="Wheat">
    <telerik:RadContextMenu.ContextMenu>
        <telerik:RadContextMenu Grid.IsSharedSizeScope="True">
            <telerik:RadContextMenu.Items>
                <telerik:RadMenuItem HorizontalContentAlignment="Stretch">
                    <telerik:RadMenuItem.Header>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" SharedSizeGroup="AccessKey" />
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="Copy" />
                            <TextBlock Margin="8 0" Grid.Column="1" Text="Ctrl + C" Foreground="Gray" />
                        </Grid>
                    </telerik:RadMenuItem.Header>
                </telerik:RadMenuItem>
                <telerik:RadMenuItem HorizontalContentAlignment="Stretch">
                    <telerik:RadMenuItem.Header>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" SharedSizeGroup="AccessKey" />
                            </Grid.ColumnDefinitions>
                            <TextBlock Text="Paste Special" />
                            <TextBlock Margin="8 0" Grid.Column="1" Text="Ctrl + Shift + V" Foreground="Gray" />
                        </Grid>
                    </telerik:RadMenuItem.Header>
                </telerik:RadMenuItem>
            </telerik:RadContextMenu.Items>
        </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>
</Grid>

Hopefully this helps.

Kind regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Ralf
Top achievements
Rank 1
answered on 11 Dec 2012, 10:08 AM
Hello Rosen,

thank you for the example. But what we all need is to have easy approaches to get standard behaviors. So we don't have to do much coding for enviroment, and we can spend more time to implement business logic. Therefore we are using control suites like Telerik controls.
So the best way for us developers is to create a menu item, set the command to ApplicationsCommands.Copy, and thats it. The shortcuts and symbols will be added automatically then. This is much easier then creating header templates and so on. And we save time.

So, it would be perfect if you pimp up the RadMenu in one of the next releases.

Best regards,
Ralf 
 
0
Kristoffer
Top achievements
Rank 1
answered on 11 Dec 2012, 11:07 AM
Thanks for the workaround. Good to have when the project manager refuses to understand the limitations :)

Otherwise, I agree with Ralf.
I've been using oldschool MFC libraries for several years where this functionality was already present... Yay!
A skilled WPF developer should be able to implement this in less than three days. Why wait? :)
0
Rosen Vladimirov
Telerik team
answered on 11 Dec 2012, 01:08 PM
Hi Ralf and Kristoffer,

Thank you both for sending this feedback to us. We've already considered such implementation and hopefully we'll have it in the first half of 2013. For now you can use the mentioned workaround in your WPF applications.

We are really sorry for the caused inconvenience.

All the best,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Tayyab
Top achievements
Rank 1
answered on 18 Dec 2012, 06:50 PM
Hi

I am trying the same thing in Silverlight but I am binding the itemsource in code behind file . the code below is not working properly because top level item does not have hotkey. can I implement it the same thing through style ?    Please guide me 

 <Grid.Resources>
            <telerik:HierarchicalDataTemplate x:Key="MenuItemTemplate" ItemsSource="{Binding SubItems}">
                <telerik:ContainerBinding.ContainerBindings>
                    <telerik:ContainerBindingCollection>
                        <telerik:ContainerBinding PropertyName="Icon" Binding="{Binding Icon}" />
                    </telerik:ContainerBindingCollection>
                </telerik:ContainerBinding.ContainerBindings>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="{Binding Text}" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left"  Width="120"/>
                    <TextBlock Text="{Binding Summary}" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" TextAlignment="Right" />
                </Grid>
                
            </telerik:HierarchicalDataTemplate>
            <Style x:Key="MenuItemStyle" TargetType="telerik:RadMenuItem">
                <Setter Property="IsSeparator" Value="{Binding IsSeparator}" />
            </Style>
        </Grid.Resources>
        
        <telerik:RadMenu Name="MasterMenu" ItemTemplate="{StaticResource MenuItemTemplate}"
                         ItemContainerStyle="{StaticResource MenuItemStyle}" ItemClick="MasterMenu_ItemClick"
                         ClickToOpen="True" />
0
Rosen Vladimirov
Telerik team
answered on 19 Dec 2012, 12:56 PM
Hi Tayyab,

As I said in one of my previous posts - you can use AccessKeys with the special symbol "_" only in WPF. Unfortunately you are not able to do this in Silverlight.

We are sorry for the caused inconvenience.

Regards,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Priya
Top achievements
Rank 1
answered on 11 Oct 2013, 04:04 AM
Any update on the hot keys on RadMenuItem in Silverlight?
0
Rosen Vladimirov
Telerik team
answered on 15 Oct 2013, 07:29 AM
Hello Priya,

As stated before and in this workitem, this is not available in Silverlight as there are several framework limitations that prevent us to implement it.

We are sorry for the caused inconvenience. Feel free to contact us in case you have any other problems or concerns.

Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ContextMenu
Asked by
Anton
Top achievements
Rank 2
Answers by
Rosen Vladimirov
Telerik team
Ralf
Top achievements
Rank 1
Kristoffer
Top achievements
Rank 1
Tayyab
Top achievements
Rank 1
Priya
Top achievements
Rank 1
Share this question
or