Back to Devexpress

ASPxGridViewSettings.ShowColumnHeaders Property

aspnet-devexpress-dot-web-dot-aspxgridviewsettings-5f538fc8.md

latest4.4 KB
Original Source

ASPxGridViewSettings.ShowColumnHeaders Property

Specifies whether column headers are visible.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(true)]
public bool ShowColumnHeaders { get; set; }
vb
<DefaultValue(True)>
Public Property ShowColumnHeaders As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true to display column headers; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ShowColumnHeaders
ASPxGridView

.Settings .ShowColumnHeaders

| | GridViewProperties |

.Settings .ShowColumnHeaders

|

Remarks

The example below demonstrates how to hide column headers in the exported document. For this purpose, set the ShowColumnHeaders property to false in the BeforeExport event handler.

aspx
<dx:ASPxGridView ID="grid" runat="server" DataSourceID="CustomerReportsDataSource" 
    OnBeforeExport="grid_BeforeExport"/>
csharp
protected void grid_BeforeExport(object sender, DevExpress.Web.ASPxGridBeforeExportEventArgs e) {
    grid.Settings.ShowColumnHeaders = false;
}
vb
Protected Sub grid_BeforeExport(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxGridBeforeExportEventArgs)
    grid.Settings.ShowColumnHeaders = False
End Sub

When the ShowColumnHeaders property is set to false, the ColumnResizeMode property is ignored and column resizing is disabled.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ShowColumnHeaders property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-how-to-display-an-enumeration-property-as-a-drop-down-box-with-check-boxes/CS/E689.Module.Web/Editors/ASPxEnumPropertyEditorEx.cs#L41

csharp
//lookupEdit.ClientSideEvents.Init = lookupEdit.ClientSideEvents.DropDown = setSizeScript;
lookupEdit.GridViewProperties.Settings.ShowColumnHeaders = false;
lookupEdit.GridViewProperties.Settings.GridLines = GridLines.None;

xaf-how-to-display-an-enumeration-property-as-a-drop-down-box-with-check-boxes/VB/E689.Module.Web/Editors/ASPxEnumPropertyEditorEx.vb#L40

vb
'lookupEdit.ClientSideEvents.Init = lookupEdit.ClientSideEvents.DropDown = setSizeScript;
lookupEdit.GridViewProperties.Settings.ShowColumnHeaders = False
lookupEdit.GridViewProperties.Settings.GridLines = GridLines.None

See Also

Grid View

ASPxGridViewSettings Class

ASPxGridViewSettings Members

DevExpress.Web Namespace