Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DataViewBase.ColumnHeaderContentStyle Property

Gets or sets the style of the text within column headers. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

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

NuGet Package: DevExpress.Wpf.Grid.Core

#Declaration

public Style ColumnHeaderContentStyle { get; set; }

#Property Value

Type Description
Style

A Style object that represents the style of the text within column headers.

#Remarks

The image below shows a grid column whose header caption is red and has a larger font size:

ColumnHeaderCustomizationContentStyle

Specify the ColumnBase.ColumnHeaderContentStyle property to change the header content’s appearance. Use the ColumnHeaderContentStyle property to specify the common style applied to all the columns in the current GridControl’s view. The target element for these styles is the ContentControl class.

The following code sample demonstrates how to change the header caption color and increase the font size:

<dxg:GridColumn FieldName="CategoryName">               
   <dxg:GridColumn.ColumnHeaderContentStyle>
      <Style TargetType="{x:Type ContentControl}">
         <Setter Property="FontSize" Value="15" />
         <Setter Property="Foreground" Value="Red" />                        
      </Style>
   </dxg:GridColumn.ColumnHeaderContentStyle>                
</dxg:GridColumn>

Use the ColumnBase.ActualColumnHeaderContentStyle property to obtain the current column header content style.

See Also