Tag
A newer version of this page is available. Switch to the current version.

ColumnBase.HeaderCustomizationAreaTemplate Property

Gets or sets the template that defines the presentation of the customization area displayed within the column's header. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v19.1.Core.dll

Declaration

public DataTemplate HeaderCustomizationAreaTemplate { get; set; }
Public Property HeaderCustomizationAreaTemplate As DataTemplate

Property Value

Type Description
DataTemplate

A DataTemplate object that defines the presentation of the header customization area.

Remarks

The image below shows a grid column header's customization area containing a checkbox:

ColumnHeaderCustomizationAreaTemplate

Specify the HeaderCustomizationAreaTemplate property to add an element to a column header's customization area. Use the DataViewBase.ColumnHeaderCustomizationAreaTemplate property to display the customization area's content within all column headers in the current GridControl's view. The data context (binding source) for these templates is the ColumnBase class.

The following code sample demonstrates how to add a checkbox to the column header using the HeaderCustomizationAreaTemplate property:

<dxg:GridColumn FieldName="CategoryName">
   <dxg:GridColumn.HeaderCustomizationAreaTemplate>
      <DataTemplate>
         <dxe:CheckEdit IsChecked="{Binding Column.ReadOnly, Mode=TwoWay}" />
      </DataTemplate>
   </dxg:GridColumn.HeaderCustomizationAreaTemplate>
</dxg:GridColumn>

Refer to the How to: Display a Check Box within Column Headers example to learn more.

Use the ColumnBase.ActualHeaderCustomizationAreaTemplateSelector property to obtain the actual template selector.

If you have more than one template for rendering a customization area, specify the ColumnBase.HeaderCustomizationAreaTemplateSelector property to implement custom logic for selecting the required template.

See Also