Hello,
Is it possible to achieve this like on the attached file ?
Thanks in advance.
Regards.
I am trying to bind a dynamically generated menu. I have set up the following style:
<
Style
x:Key
=
"MenuItemStyle"
TargetType
=
"telerik:RadMenuItem"
>
<
Setter
Property
=
"Header"
Value
=
"{Binding Header}"
/>
<
Setter
Property
=
"IsCheckable"
Value
=
"{Binding IsCheckable}"
/>
<
Setter
Property
=
"IsSeparator"
Value
=
"{Binding IsSeparator}"
/>
<
Setter
Property
=
"IsChecked"
Value
=
"{Binding IsChecked}"
/>
<
Setter
Property
=
"Icon"
Value
=
"{Binding IconUrl}"
/>
<
Setter
Property
=
"ItemsSource"
Value
=
"{Binding SubMenuItems}"
/>
<
Setter
Property
=
"Command"
Value
=
"{Binding MenuItemClicked}"
/>
<
Setter
Property
=
"CommandParameter"
Value
=
"{Binding RelativeSource={RelativeSource Self}}"
/>
<
Setter
Property
=
"IconTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
Image
Source
=
"{Binding}"
Stretch
=
"Fill"
/>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
Window.Resources
>
This Generates the menus just fine and they appear exactly as I expect HOWEVER the command does nothing ()i.e. the MENUCLICKED. I have set up the command MenuItemClicked in the ViewModel and correct instantiated it as an ICOMMAND but it never fires the command. What am I missing??. The command is set up as follows:
public ICommand MenuItemClicked { get; set; }
MenuItemClicked = new Command<
RadMenuItem
>(c =>
{
....executesomeciodec);
});
I must have missed something but for the life of me I cannot see what. I know it is bound correctly as the menus are getting populated with the correct properties, icons and layouts.
Please advise - thank you
The snippet below is from an application for a machine shop which has a rather utilitarian menu.... I've been asked to add hot keys to some of the items; one of the menu items (as seen in the code below) I need to add the F6 key as a hotkey (note the idendical Command for clicking vs hotkey)... clicking on it works as desired, but the hotkey has seemingly no effect whatsoever.
What am I missing, or otherwise doing wrong? Thanks in advance for your help.
<telerik:RadMenuItem Name="ToolsMenu" Header="Tools">
<telerik:RadMenuItem Name="ToolsUseFinishLocationMenuItem" Header="Use Finish Location For Bin" Command="{Binding ToolsUseFinishLocationForBinCommand}" InputGestureText="F6">
<telerik:RadMenuItem.InputBindings>
<KeyBinding Key="F6" Command="{Binding ToolsUseFinishLocationForBinCommand}" />
</telerik:RadMenuItem.InputBindings>
</telerik:RadMenuItem>
</telerik:RadMenuItem>
- Run the application
- Tab around the controls
- Notice how the buttons change visual status when they receive and lose keyboard focus.
- Notice how the menu turns orange the first time it receives keyboard focus and then never changes visual state again as it receives/loses focus.
I have tried resetting background color in the LostKeyboardFocus Event on the RadMenu and its topmost RadMenuItem but that doesn't work.
How can I get a RadMenu to correctly display visual feedback as it receives/loses keyboard focus?
Hello
When I set DropDownPlacement = "Left", the MenuItem sometimes opens to the left, sometimes to the right.
If I set DropDownPlacement = "Right" the same game - the MenuItem opens sometimes left, sometimes right.
<
telerik:RadMenu
x:Name
=
"topmenu"
Grid.Row
=
"0"
Grid.ColumnSpan
=
"4"
IconColumnWidth
=
"0"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Stretch"
>
<
telerik:RadMenuItem
Header
=
"Allgemein"
DropDownPlacement
=
"Bottom"
>
<
telerik:RadMenuItem
Header
=
"Beenden"
Command
=
"{Binding ExitApplicationCommand}"
/>
<
telerik:RadMenuItem
Header
=
"Info"
Command
=
"{Binding InfoCommand}"
/>
</
telerik:RadMenuItem
>
<
telerik:RadMenuItem
Header
=
"Protokolle"
Command
=
"{Binding OpenChangeProtocolViewCommand}"
/>
<
telerik:RadMenuItem
DataContext
=
"{Binding MenuDocuments}"
ItemsSource
=
"{Binding ChildMenuItems, UpdateSourceTrigger=PropertyChanged}"
Header
=
"{Binding Header, UpdateSourceTrigger=PropertyChanged}"
StaysOpenOnClick
=
"True"
DropDownPlacement
=
"Left"
>
<
telerik:RadMenuItem.Resources
>
<
HierarchicalDataTemplate
DataType
=
"{x:Type local:MenuItemViewModel}"
ItemsSource
=
"{Binding ChildMenuItems, UpdateSourceTrigger=PropertyChanged}"
>
<
telerik:RadMenuItem
Header
=
"{Binding Header, UpdateSourceTrigger=PropertyChanged}"
Command
=
"{Binding ExecuteCommand}"
StaysOpenOnClick
=
"True"
DropDownPlacement
=
"Left"
>
<
i:Interaction.Triggers
>
<
i:EventTrigger
EventName
=
"MouseEnter"
>
<
i:InvokeCommandAction
Command
=
"{Binding MouseEnterCommand}"
/>
</
i:EventTrigger
>
</
i:Interaction.Triggers
>
</
telerik:RadMenuItem
>
</
HierarchicalDataTemplate
>
</
telerik:RadMenuItem.Resources
>
</
telerik:RadMenuItem
>
</
telerik:RadMenu
>
We would like, that all menuitem always open on the left site from parent menu.
Is this possible with the RadMenu Control?
For what purpose is the setting DropDownPlacement?
Thank you
Hello Telerik Team,
I have one problem in my WPF project. I was getting issues when we select more than 6000 documents from radgridview after select these documents i was selecting 1 documents . so it was taking near about 45 seconds time to select the single document. so from telerik team someone suggested to update the telerik versions with the newer one. after upgradation all the radmenuitems were not working and some UI things also not working,i have attached the snapshots of the radmenuitems. what i have to do for it to fix these issues.
Regards
Raju Tiwari
Hi,
the vertical alignment of InputGestureText in Office2016 Theme is faulty. In VisualStudio2013 Theme everthing is fine.
How can i correct this?
Thanks!
Hello,
I have a very simple piece of code to bind my RadMenu control to an ObservableList of Menus.
My xaml looks like this:
<telerik:RadMenu Name:"MainMenu" ItemsSource="{Binding Menus}"/>
This works fine. In order to display something more interesting, I can add:
<telerik:RadMenu Name:"MainMenu" ItemsSource="{Binding Menus}" DisplayMemberPath="Name" />
And I get the Name property of my Menus displayed.
Now I would like to get a step further as my Menu class has a SubMenus property so I try to play with RadMenuItem styling and this is where I get lost.
If I write simple code like this, that according to me should do the same as the DisplayMemberPath :
<telerik:RadMenu Name:"MainMenu" ItemsSource="{Binding Menus}" >
<telerik:RadMenu.Resources>
<Style TargetType="telerik:RadMenuItem">
<Setter Property="Header" Value="{Binding Name}"/>
</Style>
</telerik:RadMenu.Resources>
</telerik:RadMenu>
Nothing is displayed on my window when running the code.
I have checked everything, I can see in my view that the Menu is created and the items inside, etc... but the RadMenus don't display.
As soon as I comment out the Style, menus are displayed. As everything else is straightforward in my code, I think I am missing something obvious but I can't find it. There is no error in debug for binding issues or else.
I use Telerik 2017.1.22.45.
Thanks for your feedback.