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

BaseColumn.HorizontalHeaderContentAlignment Property

Gets or sets the column header’s content alignment. 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 HorizontalAlignment HorizontalHeaderContentAlignment { get; set; }

#Property Value

Type Description
HorizontalAlignment

A HorizontalAlignment enumeration value that specifies the content’s horizontal alignment.

#Remarks

Use the HorizontalHeaderContentAlignment property to align the header content:

ColumnHeaderCustomizationHeader

<dxg:GridColumn FieldName="Category" HorizontalHeaderContentAlignment="Center"/>

To align content in the column cells, follow the steps below:

  1. Create an *EditSettings object and assign it to the ColumnBase.EditSettings property.
  2. Use the BaseEditSettings.HorizontalContentAlignment property to specify the cell content alignment.

<dxg:GridColumn FieldName="Category" HorizontalHeaderContentAlignment="Center">
   <dxg:GridColumn.EditSettings>
         <dxe:TextEditSettings HorizontalContentAlignment="Center"/>
   </dxg:GridColumn.EditSettings>
</dxg:GridColumn>

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

See Also