Skip to main content

ColumnBase.HeaderPresenterType Attached Property

Gets a value that specifies which grid element contains the column’s header.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v23.2.Core.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

Returns

Type Description
HeaderPresenterType

A HeaderPresenterType enumeration value that specifies which grid element contains the column’s header.

Remarks

The following example applies different settings to column headers based on their location:

HeaderPresenterType

View Example: Customize Column Headers Based on Their Location

<Style TargetType="dxg:GridColumn">
    <Setter Property="HeaderTemplate">
        <Setter.Value>
            <DataTemplate>
                <TextBlock>
                    <TextBlock.Text>
                        <MultiBinding Converter="{local:CustomHeaderConverter}">
                            <Binding />
                            <Binding Path="(dxg:ColumnBase.HeaderPresenterType)" 
                                     RelativeSource="{RelativeSource Self}"/>
                        </MultiBinding>
                    </TextBlock.Text>
                </TextBlock>
            </DataTemplate>
        </Setter.Value>
    </Setter>
</Style>
private string GetCustomHeaderString(string originalHeader, HeaderPresenterType headerType) {
    switch (headerType) {
        case HeaderPresenterType.Headers:
            return originalHeader.Replace("Original ", "Custom\nPanel\n");
        case HeaderPresenterType.GroupPanel:
            return originalHeader.Replace("Original", "Custom Group");
        case HeaderPresenterType.ColumnChooser:
            return originalHeader.Replace("Original", "Custom Column Chooser");
    }
    return originalHeader;
}

Refer to the following help topic for more information: Header Content Customization.

See Also