GridView.ColumnHeaderTemplateSelector Property

Gets or sets the selector object that provides logic for selecting a template to use for each column header.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public DataTemplateSelector ColumnHeaderTemplateSelector { get; set; }
/** @property */
public DataTemplateSelector get_ColumnHeaderTemplateSelector ()

/** @property */
public void set_ColumnHeaderTemplateSelector (DataTemplateSelector value)

public function get ColumnHeaderTemplateSelector () : DataTemplateSelector

public function set ColumnHeaderTemplateSelector (value : DataTemplateSelector)

<object>  <object.ColumnHeaderTemplateSelector>    <MyDataTemplateSelectorImplementation .../>  </object.ColumnHeaderTemplateSelector></object>
<object DataTemplateSelector="{ResourceExtensionDataTemplateClassKey}"/>
 ResourceExtension   StaticResource or DynamicResource. StaticResource typically provides better performance.  DataTemplateClassKey  An x:Key resource key that refers to a custom DataTemplateSelector subclass that implements a practical SelectTemplate override. For information about how to map your custom class, see XAML Namespaces and Namespace Mapping. You can also programmatically add an instance of your DataTemplateSelector class as a resource to the application resource dictionary.  MyDataTemplateSelectorImplementation  A subclass of DataTemplateSelector that implements a practical SelectTemplate override. For information about how to map your custom class, see XAML Namespaces and Namespace Mapping. 

Property Value

The DataTemplateSelector object that determines the data template to use for each column header. The default value is a null reference (Nothing in Visual Basic).

Identifier field

ColumnHeaderTemplateSelectorProperty

Metadata properties set to true

None

If you do not set this property, the default logic is to use the ColumnHeaderTemplate property for all columns if it is defined.

If the ColumnHeaderTemplate property and the ColumnHeaderTemplateSelector property are both set, the ColumnHeaderTemplate property takes precedence.

This property represents one of several ways to lay out and style column headers. For more information, see GridView Column Header Styles and Templates Overview.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show: