Styling a Databound menu

2 posts, 0 answers
  1. Mat Guthrie
    Mat Guthrie avatar
    8 posts
    Member since:
    May 2010

    Posted 31 Jan 2011 Link to this post

    Hi,

    Please excuse my ignorance but I'm just beginning to do battle with WPF styling / Templates etc.

    I'm trying to style up a RadMenu that is databound and uses the  HierarchicalDataTemplate. I'd like to have the header row menu items styled differently to the child items, including font sizes, mouseover colors / animations etc. The examples contained in the documentation seem to be very limited, showing only the most basic of style setters and no examples of selecting different styles based on the type of menu item (header item or child). Can anyone provide me with a more complete example of radically changing the styling of a RadMenu as described above?

    Many thanks

    Mat
  2. Pana
    Admin
    Pana avatar
    748 posts

    Posted 03 Feb 2011 Link to this post

    Hello Mat Guthrie,

    Have you checked this example:
    http://demos.telerik.com/wpf/?Menu/WPF/Customization
    It uses StyleSelector to set different styles for the different menu items. Note that in the SelectTemplate method you will have parameters for both the RadMenuItem and the item that comes from the ItemsSource. You can cast them and use their properties to specify what templates the RadMenuItems will use (this includes whether the item is top or sub level).

    Regards,
    Pana
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top