ColumnHeaderTemplate Property

GridView.ColumnHeaderTemplate Property


Gets or sets a template to use to display the column headers.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public DataTemplate ColumnHeaderTemplate { get; set; }

Property Value

Type: System.Windows.DataTemplate

The DataTemplate to use to display the column headers as part of the GridView. The default value is null.

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.

<object ColumnHeaderTemplate="{ResourceExtension TemplateResourceKey}"/>


One of the following: StaticResource, or DynamicResource. See XAML Resources.


The key that identifies the template being requested. The key refers to an existing resource in a ResourceDictionary.


Property element syntax is technically possible, but not recommended. See Inline Styles and Templates. A binding reference using or is also possible, but uncommon.

Identifier field


Metadata properties set to true


The following example shows how to set the ColumnHeaderTemplate property.

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft