GridViewHeaderRowPresenter.ColumnHeaderTemplateSelector Property
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
Gets or sets a DataTemplateSelector that provides logic that selects the data template to use to display a column header.
Assembly: PresentationFramework (in PresentationFramework.dll)
Property Value
Type: System.Windows.Controls.DataTemplateSelectorThe DataTemplateSelector that chooses the DataTemplate to use to display each column header. The default is null.
If the ColumnHeaderTemplate property and the ColumnHeaderTemplateSelector property are both set, the ColumnHeaderTemplate takes precedence.
When you implement this class as part of a GridView view mode, the value of this property is bound to the value of the ColumnHeaderTemplateSelector property on the GridView.
You can customize column headers in a GridView view mode by using a variety of properties that are found in this class and in related classes. For more information about these properties, and about the precedence between them, see GridView Column Header Styles and Templates Overview.
<object ColumnHeaderTemplateSelector="{ResourceExtension DataTemplateSelectorClassKey}"/>
<object> <object.ColumnHeaderTemplateSelector> <MyDataTemplateSelectorImplementation .../> </object.ColumnHeaderTemplateSelector> </object>
- MyDataTemplateSelectorImplementation
A class derived from DataTemplateSelector that implements a practical SelectTemplate override. For information about how to map your custom class, see XAML Namespaces and Namespace Mapping for WPF XAML.
- ResourceExtension
One of the following: StaticResource, or DynamicResource. See XAML Resources.
- DataTemplateSelectorClassKey
The key that identifies the selector implementation being requested. The key refers to a derived class that implements a practical SelectTemplate override. For information about how to map your custom class, see XAML Namespaces and Namespace Mapping for WPF XAML. You can also programmatically add an instance of your DataTemplateSelector class as a resource to a resource dictionary.
Available since 3.0