Back to Devexpress

GridViewColumn.HeaderStyle Property

aspnet-devexpress-dot-web-dot-gridviewcolumn-bb635fde.md

latest2.2 KB
Original Source

GridViewColumn.HeaderStyle Property

Specifies the appearance of the column’s header.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public virtual GridViewHeaderStyle HeaderStyle { get; }
vb
Public Overridable ReadOnly Property HeaderStyle As GridViewHeaderStyle

Property Value

TypeDescription
GridViewHeaderStyle

Style settings that specify the appearance of the column’s header.

|

Remarks

The HeaderStyle property allows you to specify the appearance of the column’s header in markup and in a CSS class.

To customize the appearance of all column headers, specify the control’s Header property.

Markup Example

aspx
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False">
    <Columns>
        <dx:GridViewDataTextColumn FieldName="CompanyName" VisibleIndex="0">
            <HeaderStyle BackColor="Yellow" ForeColor="SteelBlue" />
        </dx:GridViewDataTextColumn>
        <%--...--%>
    </Columns>
</dx:ASPxGridView>

CSS Example

css
#ASPxGridView1 .columnHeaderStyle {
    background-color: yellow;
    color: steelblue;
}
aspx
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False">
    <Columns>
        <dx:GridViewDataTextColumn FieldName="CompanyName" VisibleIndex="0">
            <HeaderStyle CssClass="columnHeaderStyle" />
        </dx:GridViewDataTextColumn>
        <%--...--%>
    </Columns>
</dx:ASPxGridView>

See Also

GridViewColumn Class

GridViewColumn Members

DevExpress.Web Namespace