Template Selectors Overview

Telerik UI for WPF Ninja image

The Template Selectors is part of Telerik UI for WPF, a professional grade UI library with 140+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.

What is a Template Selector?

The DataTemplateSelector provides a way to apply data templates based on custom logic.

Typically, you use a template selector when you have more than one data template defined for the same type of objects. For example, use it if your binding source is a list of student objects and you want to apply a particular template to the part-time students. You can do this by creating a class that inherits from DataTemplateSelector and by overriding the SelectTemplate() method. Once your class is defined you can assign an instance of the class to the template selector property of your element.

For more information, you can check the DataTemplateSelector Class msdn article.

See Also

In this article
Not finding the help you need? Improve this article