Class DataTemplateSelector
Provides a way to choose a DataTemplate based on the data object and the data-bound element.
Inheritance
Namespace: Telerik.Windows.Controls
Assembly: Telerik.Windows.Controls.dll
Syntax
public class DataTemplateSelector : Object
Remarks
Typically, you create a DataTemplateSelector when you have more than one DataTemplate for the same type of objects and you want to supply your own logic to choose a DataTemplate to apply based on the properties of each data object.
To create a template selector, create a class that inherits from DataTemplateSelector and override the SelectTemplate method. Once your class is defined you can assign an instance of the class to the template selector property of your element.
Constructors
DataTemplateSelector()
Declaration
public DataTemplateSelector()
Methods
SelectTemplate(Object, DependencyObject)
When overridden in a derived class, returns a DataTemplate based on custom logic.
Declaration
public virtual DataTemplate SelectTemplate(object item, DependencyObject container)
Parameters
System.Object
item
The data object for which to select the template. |
System.Windows.DependencyObject
container
The data-bound object. |
Returns
System.Windows.DataTemplate
|