aspnet-devexpress-dot-web-dot-aspxgridviewsettings-5f538fc8.md
Specifies whether column headers are visible.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
[DefaultValue(true)]
public bool ShowColumnHeaders { get; set; }
<DefaultValue(True)>
Public Property ShowColumnHeaders As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | true |
true to display column headers; otherwise, false.
|
You can access this nested property as listed below:
| Object Type | Path to ShowColumnHeaders |
|---|---|
| ASPxGridView |
.Settings .ShowColumnHeaders
| | GridViewProperties |
.Settings .ShowColumnHeaders
|
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.
<dx:ASPxGridView ID="grid" runat="server" DataSourceID="CustomerReportsDataSource"
OnBeforeExport="grid_BeforeExport"/>
protected void grid_BeforeExport(object sender, DevExpress.Web.ASPxGridBeforeExportEventArgs e) {
grid.Settings.ShowColumnHeaders = false;
}
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.
//lookupEdit.ClientSideEvents.Init = lookupEdit.ClientSideEvents.DropDown = setSizeScript;
lookupEdit.GridViewProperties.Settings.ShowColumnHeaders = false;
lookupEdit.GridViewProperties.Settings.GridLines = GridLines.None;
'lookupEdit.ClientSideEvents.Init = lookupEdit.ClientSideEvents.DropDown = setSizeScript;
lookupEdit.GridViewProperties.Settings.ShowColumnHeaders = False
lookupEdit.GridViewProperties.Settings.GridLines = GridLines.None
See Also