Export (0) Print
Expand All

GridViewHeaderRowPresenter.ColumnHeaderTemplateSelector Property

Gets or sets a DataTemplateSelector that provides logic that selects the data template to use to display a column header.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public DataTemplateSelector ColumnHeaderTemplateSelector { get; set; }
<object>
  <object.ColumnHeaderTemplateSelector>
    <MyDataTemplateSelectorImplementation .../>
  </object.ColumnHeaderTemplateSelector>
</object>
<object ColumnHeaderTemplateSelector="{ResourceExtension DataTemplateSelectorClassKey}"/>

XAML Values

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 Resources Overview.

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.

Property Value

Type: System.Windows.Controls.DataTemplateSelector
The 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.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft