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.v24.2.Core.dll
NuGet Package: DevExpress.Wpf.Grid.Core
Declaration
See GetHeaderPresenterType(DependencyObject) and SetHeaderPresenterType(DependencyObject, HeaderPresenterType).
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:
<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