Template and Style Selectors

The RadMenu and the RadMenuItem controls come with a set of selector properties. Typically, you use a template or style selector when you have more than one data template or style defined for the same type of objects.

Here is a list of the selectors provided by the RadMenu control:

  • ItemTemplateSelector- used to select the DataTemplate that is set to the HeaderTemplate property of the child RadMenuItems.

  • ItemContainerStyleSelector - used to select the Style that is applied to the child RadMenuItems.

And a list of the selectors provided by the RadMenuItem control:

  • HeaderTemplateSelector - used to select the DataTemplate that is set to its HeaderTemplate property.

  • ItemContainerStyleSelector - used to select the Style that is applied to the child RadMenuItems.

  • ItemTemplateSelector - used to select the DataTemplate that is set to the HeaderTemplate property of the child RadMenuItems.

These properties of the RadMenuItem should be set through the ItemContainerStyle of the parent item. If you set the ItemContainerStyle property of the RadMenu only, it will get inherited in the hierarchy, unless it is not explicitly set somewhere.

The HierarchicalDataTemplate used with the RadMenu also exposes ItemContainerStyleSelector and ItemTemplateSelector properties.

See Also

In this article