Styling RadMenuItem

4 posts, 0 answers
  1. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 18 Apr 2013 Link to this post

    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
  2. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 18 Apr 2013 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 30 Apr 2013 Link to this post

    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
  5. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 02 May 2013 Link to this post

    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.

Back to Top