Back to Devexpress

DataViewBase.ColumnHeaderImageStyle Property

wpf-devexpress-dot-xpf-dot-grid-dot-dataviewbase-c3470091.md

latest3.0 KB
Original Source

DataViewBase.ColumnHeaderImageStyle Property

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

Namespace : DevExpress.Xpf.Grid

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

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public Style ColumnHeaderImageStyle { get; set; }
vb
Public Property ColumnHeaderImageStyle As Style

Property Value

TypeDescription
Style

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

|

Remarks

The following image shows a grid column with a header image:

Specify the BaseColumn.Image property to add an image to the column header. The following code sample demonstrates how to use this property:

xaml
<dxg:GridColumn FieldName="CategoryName" Image="Image.png"></dxg:GridColumn>

Note

Set the TableView.AllowPrintColumnHeaderImage (or TreeListView.AllowPrintColumnHeaderImage) property to true to enable printing a column header’s image.

You can change the header’s image properties. The image below shows a grid column whose header has an image with altered sizes and margins:

Specify the BaseColumn.HeaderImageStyle property to change the column header’s image properties. Use the ColumnHeaderImageStyle property to specify a common style applied to all columns in the current GridControl’s view. The target element for this style is the Image class.

The following code demonstrates how to change the header’s image properties:

xaml
<dxg:GridColumn FieldName="CategoryName" Image="Image.png">
   <dxg:GridColumn.HeaderImageStyle>
      <Style TargetType="Image">
         <Setter Property="Width" Value="25"></Setter>
         <Setter Property="Margin" Value="5,5,15,5"></Setter>
      </Style>
   </dxg:GridColumn.HeaderImageStyle>
</dxg:GridColumn>

See Also

DataViewBase Class

DataViewBase Members

DevExpress.Xpf.Grid Namespace