This is a migrated thread and some comments may be shown as answers.

Styling RadMenuItem

3 Answers 349 Views
Menu
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 18 Apr 2013, 09:04 AM
Hi,

how do i style the RadMenuItem? Foreground, Font-Family, FontSize,...?
<telerik:RadMenuItem Header="Einkauf" Background="Transparent" Command="{Binding AddItemCommand}" VerticalAlignment="Center"  HorizontalAlignment="Left" HorizontalContentAlignment="Center" FontFamily="DicotMedium" FontSize="18">
        <telerik:RadMenuItem.Icon>
                 <Image Width="16" Height="16" Margin="0" Source="Style/Images/cockpit.png"  />
        </telerik:RadMenuItem.Icon>
        <telerik:RadMenuItem Command="{Binding AddItemCommand}" CommandParameter="Tab1" Header="Tab 1" />
        <telerik:RadMenuItem Command="{Binding AddItemCommand}" CommandParameter="Tab2" Header="Tab 2" />
</telerik:RadMenuItem>

Thanks
Best Regards Rene

3 Answers, 1 is accepted

Sort by
0
Rosen Vladimirov
Telerik team
answered on 18 Apr 2013, 02:23 PM
Hello Rene,

In order to achieve this, you will have to use HeaderTemplate. For example the code below will make all RadMenuItem Headers with Red foreground:
<Style TargetType="telerik:RadMenuItem" >
    <Setter Property="HeaderTemplate">
        <Setter.Value>
            <DataTemplate>
                <TextBlock Text="{Binding}" Foreground="Red"/>
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>

Hopefully this helps. Feel free to contact us if you have any suggestions or concerns.


Greetings,
Rosen Vladimirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
ITA
Top achievements
Rank 1
answered on 30 Apr 2013, 12:49 PM
Hi,

this is my xaml:
<telerik:RadMenuItem Header="{Binding Source={StaticResource Lang}, XPath=MenueKunden/@Header}"  Style="{StaticResource MenuSubItemStyle}">                                           
       <telerik:RadMenuItem Command="{Binding AddItemCommand}" CommandParameter="Kunde" Header="{Binding Source={StaticResource Lang}, XPath=MenueKunden/@Header}"  Style="{StaticResource MenuSubItemStyle}" Foreground="#FFE61616" />
       <telerik:RadMenuItem Command="{Binding AddItemCommand}" CommandParameter="Kundenkontakt" Header="{Binding Source={StaticResource Lang}, XPath=MenueKundenkontakt/@Header}"  Style="{StaticResource MenuSubItemStyle}" />
        <telerik:RadMenuItem Command="{Binding AddItemCommand}" CommandParameter="Interessent" Header="{Binding Source={StaticResource Lang}, XPath=MenueInteressent/@Header}"  Style="{StaticResource MenuSubItemStyle}" />
        <telerik:RadMenuItem Command="{Binding AddItemCommand}" CommandParameter="Interessentenkontakt" Header="{Binding Source={StaticResource Lang}, XPath=MenueInteressentkontakt/@Header}"  Style="{StaticResource MenuSubItemStyle}" />
</telerik:RadMenuItem>

it's not possible to Change the Foregrodun and Font-Family of the RadMenuItem?!

Thanks
Best Regards
Rene
0
Hristo
Telerik team
answered on 02 May 2013, 02:01 PM
Hi Rene,

RadMenuItem has Foreground and FontFamily properties.
You could set them locally or in the style that you apply to RadMenuItems.

Let us know if you need more information.

Greetings,
Hristo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Menu
Asked by
ITA
Top achievements
Rank 1
Answers by
Rosen Vladimirov
Telerik team
ITA
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or