Styling RadDataFilter

Before reading this topic, you might find it useful to get familiar with the Template Structure of the RadDataFilter and the Template Structure of the DataFilterPresenter.

RadDataFilter exposes a Style property which allows you to apply a style to it and modify its appearance.

Using Implicit Styles gives you the ability to easily extract and edit the default ControlTemplates of the controls. You can follow the article on different approaches on how to extract the ControlTemplates.

Modifying the Default Style

To copy the default styles, load your project in Expression Blend and open the User Control that holds RadDataFilter. In the 'Objects and Timeline' pane select the RadDataFilter you want to style. From the menu choose Object -> Edit Style -> Edit a Copy. You will be prompted for the name of the style and where to be placed.

If you choose to define the style in Application, it would be available for the entire application. This allows you to define a style only once and then reuse it where needed.

After clicking 'OK', Expression Blend will generate the default style of RadDataFilter control in the Resources section of your User Control. The properties available for the style will be loaded in the 'Properties' pane and you will be able to modify their default values. You can also edit the generated XAML in the XAML View or in Visual Studio.

As the UI of RadDataPager is wrapped in DataFilterPresenter control, you have to style it, too. It can be found in the ControlTemplate for RadDataFilter. Bring the ControlTemplate into edit by returning to the main scene, selecting RadDataPager and choosing from the menu Object -> Edit Template -> Edit Current. Select DataFilterPresenter control and from the menu choose *Object -> Edit Style -> Edit a Copy. *This will generate the default style for it in the Resources section.

In the generated Style for the DataFilterPresenter you have to find the following:

  • DataFilterPresenterItemTemplate - a HierarchicalDataTemplate, used to display the filtering hierarchy.

  • DataFilterPresenterHeaderTemplate - a DataTemplate, used to display the headers of the composite filters.

These two templates contain a control that represents RadDataFilter's UI - the FilterControl. Modifying its Style, will modify the visual appearance of RadDataFilter.

To learn how to style FilterControl you can read this topic.

See Also

In this article