Telerik Forums
UI for WPF Forum
0 answers
296 views

I'm using a simple RadMenu and I am having a bit of trouble getting it to look correctly in the application.

It seems to be adding a small padding area to the surrounding the first menu item. (I've attached an image of how it renders in the application)

Here is the XAML: 

<DockPanel Height="40" >
    <telerik:RadMenu Height="40" Width="100" HorizontalAlignment="Right" VerticalAlignment="Center" FlowDirection="RightToLeft" IconColumnWidth="0" Padding="0" Margin="0">
        <telerik:RadMenuItem Width="100" Header="Menu" Click="RadMenuItem_Click" HorizontalAlignment="Right" Margin="0,0,-2,0" Height="40" >
            <telerik:RadMenuItem Header="Main" Height="40"/>
            <telerik:RadMenuItem Header="Alarms" Height="40"/>
            <telerik:RadMenuItem Header="Configuration" Height="40"/>
            <telerik:RadMenuItem Header="Exit" Height="40"/>
        </telerik:RadMenuItem>
    </telerik:RadMenu>
</DockPanel>

Also, I don't want the arrow icon to appear, but I don't seem to be able to get rid of it.

I'm using the Windows8Touch theme.

Any help would be appreciated.

 

paully21
Top achievements
Rank 1
 asked on 22 Dec 2015
4 answers
467 views

Sir,
I have created menu with sub menu.But while i click on menu,the sub menu is opening just right of that menu.I want to open  below and sub menu letter alignment should middle.If you make template Grid Horizontal Alignment="left",then it is opening just below it properly but letter alignment becoming left.I want letter  alignment should be middle.Here i have attached my sample project link .If there is way to solve this,please help me.

 

https://drive.google.com/a/aisofttech.com/file/d/0Bz9Sv7mmLtkeeFBGTXB1OFVNTnM/view?usp=sharing​

Avinash
Top achievements
Rank 1
 answered on 08 Sep 2015
5 answers
822 views
In my application I do not want to waste the space in TitleBar. So I wanted to have the menu in TitleBar. How do I achieve it using Rad controls of Telerik?
Martin Ivanov
Telerik team
 answered on 20 Jul 2015
3 answers
256 views

 I am following the documentation guide Binding to Dynamic Data with one change, the RadMenu.ItemContainerStyle is set from code and not from XAML.

_menu = new RadMenu();
var s = Application.Current.Resources["MenuItemStyle"] as Style;
if (s != null)
{
    _menu.ItemContainerStyle = s;
}

The XAML template matches the example, expect for the name of the nested items to match the class used to construct the menu items:

                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                    xmlns:local="clr-namespace:Anvil.Desktop.Windows8">
     
    <Style x:Key="MenuItemStyle" TargetType="telerik:RadMenuItem">
        <Setter Property="Header" Value="{Binding Text}"/>
        <Setter Property="ItemsSource" Value="{Binding Items}"/>
        <Setter Property="Icon" Value="{Binding IconUrl}" />
        <Setter Property="IconTemplate" >
            <Setter.Value>
                <DataTemplate>
                    <Image Source="{Binding}" Stretch="None"/>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
     
</ResourceDictionary>

The resource dictionary is merged and available in the merged resources but the menu items are not rendered as in the with_itemcontainerstyle_set.png attachment and when removing the style setting code:

_menu = new RadMenu();
var s = Application.Current.Resources["MenuItemStyle"] as Style;
if (s != null)
{
    // _menu.ItemContainerStyle = s;
}

the class names of the menu items are displayed as in  without_itemcontainerstyle_set.png

Any suggestions?
 

 

 

 

Kalin
Telerik team
 answered on 18 May 2015
0 answers
107 views

Hi team,

I find the pop-up containing the RadMenuItem is always aligning to the right against the clicked parent Menu Item. I want to it be automatically detect the boundary, just like the context menu windows desktop. Any solutions?

Wishes,

Jingfei

Jackey
Top achievements
Rank 1
 asked on 11 Apr 2015
4 answers
133 views
I have a RadDropDownButton whose DropDownContent is a RadContextMenu.

In the first RadMenuItem ("New Project") inside the RadContextMenu I have various input controls.

I can't get tabbing between these input controls to work at all. With focus on one textbox or combobox, pressing the tab key does nothing. (Before I set IsTabStop="false" on all the RadMenuItems, this would result in tabbing through the RadMenuItems, which I didn't want).

Here's the code:
<telerik:RadDropDownButton Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,5,25,0" Content="Actions" Width="100">
     <telerik:RadDropDownButton.DropDownContent>
 
         <telerik:RadContextMenu HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top">
             <telerik:RadMenuItem Header="New Project" IsTabStop="False">
                 <Grid Width="300">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="Auto"/>
                         <ColumnDefinition Width="*"/>
                     </Grid.ColumnDefinitions>
                     <Grid.RowDefinitions>
                         <RowDefinition Height="25"/>
                         <RowDefinition Height="25"/>
                         <RowDefinition Height="25"/>
                         <RowDefinition Height="25"/>
                         <RowDefinition Height="25"/>
                         <RowDefinition Height="25"/>
                         <RowDefinition Height="*"/>
                     </Grid.RowDefinitions>
 
                     <TextBlock Text="Project No:" Grid.Row="0" Grid.Column="0" Margin="0,2,5,0" />
                     <TextBox Name="newProjectNo"
                              Grid.Row="0" Grid.Column="1"
                              HorizontalAlignment="Left"
                              Width="100"
                              Margin="0,2,0,2"
                              TabIndex="1"
                              IsTabStop="True"
                              VerticalAlignment="Top"></TextBox>
 
                     <TextBlock Text="Applicant:" Grid.Row="1" Grid.Column="0" Margin="0,2,5,0" />
                     <telerik:RadAutoCompleteBox Name="newMuniCode"
                                                 Grid.Row="1" Grid.Column="1"
                                                 HorizontalAlignment="Left"
                                                 Margin="0,2,0,0"
                                                 TabIndex="2"
                                                 IsTabStop="True"
                                                 Width="200"
                                                 VerticalAlignment="Top"/>
 
                     <TextBlock Text="Project Engineer:" Grid.Row="2" Grid.Column="0" Margin="0,2,5,0" />
                     <telerik:RadComboBox x:Name="ProjectEngineerSelection"
                                          Grid.Row="2" Grid.Column="1"
                                          Margin="0,2,0,0"
                                          TabIndex="3"
                                          IsTabStop="True"
                                          ClearSelectionButtonVisibility="Visible"
                                          ClearSelectionButtonContent="Show all"
                                          DisplayMemberPath="DisplayName"
                                          ItemsSource="{Binding ProjectEngineers}"
                                          SelectedItem="{Binding SelectedEngineer, Mode=TwoWay}" />
 
                     <TextBlock Text="Project Manager:" Grid.Row="3" Grid.Column="0" Margin="0,2,5,0" />
                     <telerik:RadComboBox x:Name="ProjectManagerSelection"
                                          Grid.Row="3" Grid.Column="1"
                                          Margin="0,2,0,0"
                                          TabIndex="4"
                                          IsTabStop="True"
                                          ClearSelectionButtonVisibility="Visible"
                                          ClearSelectionButtonContent="Show all"
                                          DisplayMemberPath="DisplayName"
                                          ItemsSource="{Binding ProjectManagers}"
                                          SelectedItem="{Binding SelectedManager, Mode=TwoWay}" />
 
                     <TextBlock Text="NYC Project?" Grid.Row="4" Grid.Column="0" Margin="0,2,5,0" />
                     <CheckBox x:Name="NycProjectCheckBox" 
                               Grid.Row="4" Grid.Column="1"
                               Margin="0,2,0,0"
                               IsTabStop="True"
                               TabIndex="5" />
 
                     <TextBlock Text="NYC Service Area:" Grid.Row="5" Grid.Column="0" Margin="0,2,5,0" />
                     <telerik:RadComboBox x:Name="NycServiceAreaSelection"
                                          Grid.Row="5" Grid.Column="1"
                                          Margin="0,2,0,0"
                                          TabIndex="6"
                                          IsTabStop="True"
                                          IsEnabled="{Binding IsChecked, ElementName=NycProjectCheckBox }"
                                          ClearSelectionButtonVisibility="Visible"
                                          ClearSelectionButtonContent="Show all"
                                          DisplayMemberPath="DisplayName"
                                          ItemsSource="{Binding NycServiceAreas}"
                                          SelectedItem="{Binding SelectedNycServiceArea, Mode=TwoWay}" />
 
                     <telerik:RadButton Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="2"  Content="Create Project"
                                        HorizontalAlignment="Center"
                                        Height="Auto"
                                        Margin="0,10,0,0"
                                        VerticalAlignment="Top"
                                        TabIndex="7"
                                        IsTabStop="True"
                                        Width="100"
                                        Command="" />
 
                 </Grid>
             </telerik:RadMenuItem>
 
             <telerik:RadMenuItem Header="Copy Project" IsTabStop="False">
                 <Grid Width="200">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="Auto"/>
                         <ColumnDefinition Width="*"/>
                     </Grid.ColumnDefinitions>
                     <Grid.RowDefinitions>
                         <RowDefinition Height="25"/>
                         <RowDefinition Height="*"/>
                     </Grid.RowDefinitions>
 
                     <TextBlock Text="New Project No:" Grid.Row="0" Grid.Column="0" Margin="0,2,5,0" />
                     <telerik:RadMaskedTextInput Name="copyProjectNo"
                                                 Grid.Row="0" Grid.Column="1"
                                                 Mask="0000-00-00"
                                                 HorizontalAlignment="Left"
                                                 Margin="0,0,0,0"
                                                 VerticalAlignment="Top"/>
 
                     <telerik:RadButton Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"  Content="Copy Project"
                                        HorizontalAlignment="Center"
                                        Height="Auto"
                                        Margin="0,10,0,0"
                                        VerticalAlignment="Top"
                                        Width="100"
                                        Command="" />
                 </Grid>
             </telerik:RadMenuItem>
 
             <!--<telerik:RadMenuItem Header="{Binding CurrentHeader}"-->
             <telerik:RadMenuItem IsTabStop="False" Header="Cost Increase"
                 IsEnabled="{Binding CurrentProjectIsNyc}"
                                  Command="">
             </telerik:RadMenuItem>
 
             <telerik:RadMenuItem IsTabStop="False" Header="99 Project"
                                  IsEnabled="{Binding CurrentProjectIsNyc}"
                                  Command="">
             </telerik:RadMenuItem>
         </telerik:RadContextMenu>
 
     </telerik:RadDropDownButton.DropDownContent>
 </telerik:RadDropDownButton>

Thanks,

Greg
David
Top achievements
Rank 1
 answered on 27 Mar 2015
2 answers
636 views
Hi,
My Telerik control version is 2014.3.1202.40 and I'm using the Expression Dark theme.
I'd like to modify the color of menu item and it background when the menu item is highlighted (i.e. when the mouse is over). For example, in the attached screen dump, I'd like to set "Copy" to red, and its background to green. I try to find the colors in Telerik.Windows.Controls.Navigation.xaml, but don't know which item to change. Could you help me with that? Thanks.

Regards,
Gong
Vadimir
Top achievements
Rank 1
 answered on 03 Mar 2015
1 answer
1.1K+ views
Hi,

My question is very very very simple ..... and though I'm struggling achieving this.
All I want, is a menu item being an image (via the ICON property) and on MouseOver event, change that picture with another one...... It's that easy but can't make it happen. Why the hell is this so complex ?

Anyone to help ?

01.<telerik:RadMenu Grid.Row="2" Grid.Column="1" Width="40" HorizontalAlignment="Right" Background="Transparent" ClickToOpen="True">
02.    <telerik:RadMenuItem Header="" Width="40" Height="40" ToolTip="Settings">
03.        <telerik:RadMenuItem.Icon>
04.            <Image x:Name="btnSetting" Source="Resources/setting.png" Stretch="UniformToFill">
05.            </Image>
06.        </telerik:RadMenuItem.Icon>
07.        <Trigger Property="IsMouseOver" Value="true">
08.            <Setter TargetName="btnSetting" Property="Source" Value="Resources/setting-hover.png"></Setter>
09.        </Trigger>
10.    </telerik:RadMenuItem>
11.</telerik:RadMenu>

On compile, I get an error msg saying IsMouseOver is not a valid Event and if I change this into "Property="Mouse.MouseOver" then it says not recognized or not accessible ??????

Cheers,

Chris
Masha
Telerik team
 answered on 02 Mar 2015
1 answer
104 views
I am trying to create a menu where the top section is databound, with a divider, and then a couple static items on the bottom  Like this:

Link 1
Link 2
Link 3
----------
Add Link

So the user can delete Links by right clicking.

So is there a way to mix data bound and static items in a menu?
Kalin
Telerik team
 answered on 25 Feb 2015
4 answers
247 views
Hello gurus! :-)

I am working on a project where one specific menu needs to have its sub menus open on the left rather than the right. I have tried the Placement property on the popups in the styles, but they don't seem to have any effect. Can you please help me?
Eric Moreau
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 04 Feb 2015
Narrow your results
Selected tags
Tags
+112 more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?