Telerik Forums
UI for WPF Forum
2 answers
16 views

Please help. I'm trying to get keyboard inputs to work for a RadMenu. Here are the three different ways I'm trying to get working. Just to be clear, NONE work. And yes, there are valid commands backing these. When I try this with Window.InputBindings I can get it to work, but i would like to have the keyboard declaration as near the menu as possible. This shouldn't be this hard, please help.

<telerik:RadMenu Grid.Row="0" NotifyOnHeaderClick="True" VerticalAlignment="Center" Grid.ColumnSpan="3">
			<telerik:RadMenuItem Header="_File">
				<telerik:RadMenuItem Header="_New" InputGestureText="Ctrl+N" Command="{Binding NewCommand}">
					<telerik:RadMenuItem.InputBindings>
						<KeyBinding Gesture="Ctrl+N" Command="{Binding NewCommand}"/>
					</telerik:RadMenuItem.InputBindings>
				</telerik:RadMenuItem>
				<telerik:RadMenuItem Header="_Save" InputGestureText="Ctrl+S" CommandTarget="{Binding SaveCommand, Mode=OneWay}" />
				<telerik:RadMenuItem Header="_Cancel" InputGestureText="ESC"/>
				<telerik:RadMenuItem Header="_Delete" InputGestureText="Ctrl+D" Command="{Binding DeleteCommand}" />
				<telerik:RadMenuSeparatorItem />
				<telerik:RadMenuItem Header="E_xit" InputGestureText="Alt+F4" Command="{Binding FileExitCommand}" />
			</telerik:RadMenuItem>
			<telerik:RadMenuItem Header="_Help">
				<telerik:RadMenuItem Header="_Support" Command="{Binding NavigateToAvantiSupportWebpageCommand}" CommandParameter="https://avantisystems.com/support-portal/"/>
				<telerik:RadMenuSeparatorItem />
				<telerik:RadMenuItem Header="_About" Command="{Binding HelpAboutCommand}"/>
			</telerik:RadMenuItem>
		</telerik:RadMenu>
Peter
Top achievements
Rank 1
Iron
 answered on 15 Feb 2024
1 answer
30 views

Hi,

I currently am using a RadMenuItem to show one particular Icon for example the Whatsapp logo.

When I hover over the RadMenuItem I would like the icon to change to another version (white) which will be more visible due to our RadMenuItem mouse over having a darker background.

The code below is showing the original logo but the IsMouseOver trigger does not appear to be working.

Here is my code:

MainWindow.Xaml

                        <telerik:RadMenuItem Height="30" 
                                             Command="{Binding EmailSupportCommand}"
                                             FontSize="14" IconColumnWidth="30" Header="Email info@.com"
                                             >
                            <telerik:RadMenuItem.Icon>
                                <Image>
                                    <Image.Style>
                                        <Style TargetType="{x:Type Image}">
                                            <Setter Property="Source" Value="..\..\Auxiliary\Resources\64x64\dark\email.png" />
                                            <Style.Triggers>
                                                <DataTrigger Value="True" Binding="{Binding RelativeSource={RelativeSource AncestorType=telerik:RadMenuItem}, Path=IsMouseOver}">
                                                    <Setter Property="Source" Value="..\..\Auxiliary\Resources\64x64\light\email.png" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Image.Style>
                                </Image>
                            </telerik:RadMenuItem.Icon>
                        </telerik:RadMenuItem>


Dinko
Telerik team
 answered on 03 Aug 2023
0 answers
48 views

I'm facing an issue with the RadMenu control. I have a requirement where I need to display a menu with collapsible items, and I would like some guidance on how to implement this functionality.

Here's a simplified example of my current XAML code:

<telerik:RadMenu>
    <telerik:RadMenuItem Header="Menu">
        <telerik:RadMenuGroupItem ItemsSource="{Binding Alist}" Header="A"/>
        <telerik:RadMenuGroupItem ItemsSource="{Binding Blist}" Header="B"/>
    </telerik:RadMenuItem>
</telerik:RadMenu>

In this example, I have two RadMenuGroupItems, "A" and "B", each bound to a separate list (Alist and Blist respectively). Currently, the items are displayed in an expanded state by default.

However, I would like to achieve the following behavior:

1. Initially, all the items in the lists should be collapsed, i.e., hidden.

2. Users should be able to expand and collapse the items by clicking on the respective RadMenuGroupItem headers. When the header is clicked, the items should toggle between being expanded (visible) and collapsed (hidden).

Is there a built-in way to achieve this behavior in the RadMenu or RadMenuGroupItem controls? If not, could you please provide some guidance on how I can implement this functionality myself?

I appreciate any assistance or code examples you can provide to help me accomplish this requirement.

Thank you in advance for your help.

Ohad
Top achievements
Rank 3
Bronze
Iron
Iron
 updated question on 18 May 2023
1 answer
55 views

I've tried to combine the Telerik examples 'Dynamic RadMenu' with 'Switching themes at runtime'.
I've realized, that the subitems of the RadMenu do not change the theme (color) correctly.

I think that the ItemContainerStyle don't work correctly.

I've attached an example with two RadMenu.
First is created dynamically the second is static.

In the menu you can switch to different themes.
Please have look to the submenues (file). The color don't change.

I've also realized that also the size of the icons are displayed differently.

Stenly
Telerik team
 answered on 22 Aug 2022
1 answer
61 views

Hi,

I have a RadContextMenu and want to use access keys with it, I've added underscores to headers in my RadMenuItems and functionally it's all working however the characters in the menu aren't underlined, I tried looking into this online but could only seem to find anything on getting them to appear in a RadMenu when using alt which doesn't appear to be an option for the context menu control. It seems like it should be default functionality so I don't know if maybe I'm just missing something obvious.

Thanks for any help

Stenly
Telerik team
 answered on 14 Dec 2021
1 answer
195 views

Hello.

 

I want to make it similar to an image.

I made the design, but binding is the problem.
There is a model, there is a displayname, and there are values.

The dropdown shows the sub item name when selected, and the value uses the value when the button is selected later.

(I know listbox doesn't support this. So I try to use dropdown.)

A parent item may have a value and a child may not. This shouldn't be an option.

The IsSelected function does not exist.

 

How do I put the binding and do it?

<telerik:RadDropDownButton Content="{Binding }">
	<telerik:RadDropDownButton.DropDownContent>
		<telerik:RadContextMenu x:Name="ContextMenu" ItemsSource="{Binding }">
			<telerik:RadMenuItem Header="parent name binding 1">
				<telerik:RadMenuItem Header="child name binding 1.1"/>
				<telerik:RadMenuItem Header="child name binding 1.2"/>
				<telerik:RadMenuItem Header="child name binding 1.3"/>
			</telerik:RadMenuItem>
			<telerik:RadMenuItem Header="parent name binding 2">
				<telerik:RadMenuItem Header="child name binding 2.1"/>
				<telerik:RadMenuItem Header="child name binding 2.2"/>
			</telerik:RadMenuItem>
			<telerik:RadMenuItem Header="parent name binding 3">
				<telerik:RadMenuItem Header="child null"/>
			</telerik:RadMenuItem>
		</telerik:RadContextMenu>
	</telerik:RadDropDownButton.DropDownContent>
</telerik:RadDropDownButton>

 

Thanks.

 

Psyduck
Top achievements
Rank 5
Bronze
Bronze
Bronze
 answered on 28 Jun 2021
1 answer
113 views

I set a global textblock style in app.xaml in order to styling text in dialog:

<Style TargetType="TextBlock" x:Key="{x:Type TextBlock}">
<Setter Property="Width" Value="100"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="t:StyleManager.Theme" Value="{StaticResource GlobalTheme}"/>
</Style>

But when I run the application I saw that the width property affect the space left for the menu item in toolbar:

This is the appearance without textblock style:



How can I use the style without change the Menu?
Thank you
Luigi

Martin Ivanov
Telerik team
 answered on 04 May 2021
15 answers
137 views

Hi,

If a button is placed in a RadMenu that causes navigation (in a Frame/Page setup), then the button is not getting focus and hence any Bindings that are present where the focus is are not executed before navigation takes place.  I see https://www.telerik.com/forums/radmenu-problem-404186d89499 and https://www.telerik.com/forums/i-think-i-found-a-nasty-bug which look like the same problem.  Is there any solution for this problem aside from not using RadMenu that will work for the focus being in any control?  I note that in Silverlight RadMenu does not have this problem. 

Vladimir Stoyanov
Telerik team
 answered on 22 Apr 2021
3 answers
79 views
We are looking for a way to manually resize the submenu for items that have a very large collection of menu items.  Sometimes, these lists are long enough that the submenu ends up taking up the entirety of the vertical space on screen, including the taskbar.  We'd like to limit the height of the submenus to the size of the current workspace, effectively allowing the panel to scroll more through the content and display less at a time.

A solution in xaml is not sufficient, as these submenus are dynamically populated in code.  We already have code set up to determine what we'd like to set the height of the submenu's panel to, but despite trying many ways of getting ahold of the correct components in code, we have been unable to successfully modify the submenu panel's height.

Anybody know of a good solution for this?
Vladimir Stoyanov
Telerik team
 answered on 10 Mar 2021
5 answers
131 views
We are cloning a dialog to be very similar to the Cell Styles dialog in excel and one of the things we need to do is to put a gradient style ( ie. 50% gray, crosshatch, etc ) on a RadMenuItem. Each of our cells is a RadMenuItem. Do you have any samples where something like this was accomplished?
Vladimir Stoyanov
Telerik team
 answered on 03 Aug 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?