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

Styling a Databound menu

1 Answer 58 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Mat Guthrie
Top achievements
Rank 1
Mat Guthrie asked on 31 Jan 2011, 07:58 AM
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

1 Answer, 1 is accepted

Sort by
0
Pana
Telerik team
answered on 03 Feb 2011, 01:22 PM
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>>
Tags
Menu
Asked by
Mat Guthrie
Top achievements
Rank 1
Answers by
Pana
Telerik team
Share this question
or