Hello
Question about ===> public ControlTemplate SeparatorTemplateKey {get;set}
I don't know how to use (public ControlTemplate SeparatorTemplateKey {get;set}
<
Window.Resources
>
<
ControlTemplate
x:Key
=
"SeparatorTemplate"
TargetType
=
"telerik:RadMenuItem"
>
<
Grid
HorizontalAlignment
=
"Stretch"
>
<
Rectangle
Fill
=
"Red"
Height
=
"20"
Width
=
"1"
VerticalAlignment
=
"Stretch"
/>
<
Rectangle
Fill
=
"Blue"
Height
=
"20"
Width
=
"1"
VerticalAlignment
=
"Stretch"
/>
</
Grid
>
</
ControlTemplate
>
</
Window.Resources
>
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
telerik:RadMenu
x:Name
=
"radMenu"
ClickToOpen
=
"False"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Left"
Margin
=
"8,8,0,0"
>
<
telerik:RadMenuItem
Header
=
"File"
/>
<
telerik:RadMenuItem
Header
=
"Edit"
IsSeparator
=
"True"
Template
=
"{StaticResource SeparatorTemplate}"
/>
<
telerik:RadMenuItem
Header
=
"View"
/>
</
telerik:RadMenu
>
</
Grid
>
--------
using System.Windows.Controls;
public override ObservableCollection<MenuItem> GetMenu()
{
var contextmenuitem = new ObservableCollection<MenuItem>();
var eRNode = crateMenuItem("Report");
eRNode.Items.Add(createMenuItem("Sub"));
contextmenuitem.Add(Separate); <===
ControlTemplate template = new ControlTemplate();
template.key = "Tamplate";
contextmenuitem.Add(SeparatorTemplateKey(template)); <===ControlTemplate x:Key="Template" OF XAML.xaml File .... <==I don't know grammar. How do I write code?
contextmenuitem.Add(eRNode);
}
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>
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>
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>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.
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.
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
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.
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
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.