Show hotkeys in RadMenuItem

14 posts, 0 answers
  1. Anton
    Anton avatar
    11 posts
    Member since:
    Jun 2011

    Posted 12 Jul 2012 Link to this post

    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

  2. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 17 Jul 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Ralf
    Ralf avatar
    77 posts
    Member since:
    Jun 2012

    Posted 13 Sep 2012 Link to this post

    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
  5. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 14 Sep 2012 Link to this post

    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.

  6. Kristoffer
    Kristoffer avatar
    30 posts
    Member since:
    Oct 2012

    Posted 10 Dec 2012 Link to this post

    This is a must-have feature! Can you please promise this for Q1 2013?
  7. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 11 Dec 2012 Link to this post

    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.

  8. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 11 Dec 2012 Link to this post

    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.

  9. Ralf
    Ralf avatar
    77 posts
    Member since:
    Jun 2012

    Posted 11 Dec 2012 Link to this post

    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 
     
  10. Kristoffer
    Kristoffer avatar
    30 posts
    Member since:
    Oct 2012

    Posted 11 Dec 2012 Link to this post

    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? :)
  11. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 11 Dec 2012 Link to this post

    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.

  12. Tayyab
    Tayyab avatar
    7 posts
    Member since:
    Jul 2012

    Posted 18 Dec 2012 Link to this post

    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" />
  13. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 19 Dec 2012 Link to this post

    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.

  14. Priya
    Priya avatar
    7 posts
    Member since:
    Nov 2012

    Posted 10 Oct 2013 Link to this post

    Any update on the hot keys on RadMenuItem in Silverlight?
  15. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 15 Oct 2013 Link to this post

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