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

GridBand.Caption Property

Gets or sets the band’s caption.

Namespace: DevExpress.XtraGrid.Views.BandedGrid

Assembly: DevExpress.XtraGrid.v24.2.dll

NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation

#Declaration

[DefaultValue("")]
[DXCategory("Appearance")]
[XtraSerializableProperty]
public virtual string Caption { get; set; }

#Property Value

Type Default Description
String String.Empty

A string value specifying the text to be displayed within the band header.

#Remarks

Refer to the Band Header help topic for details.

If the GridOptionsView.AllowHtmlDrawHeaders property is set to true, you can use HTML tags to format the GridColumn.Caption and GridBand.Caption. For detailed information see HTML Text Formatting.

#Example

The following example shows how to format the GridBand.Caption using HTML tags. HTML formatting is enabled via the GridOptionsView.AllowHtmlDrawHeaders property. The image below shows the result:

gridBand_HTML_formatting

gridBand1.Caption = "Production<br/><b>costs</b>";

bandedGridView1.OptionsView.AllowHtmlDrawHeaders = true;
bandedGridView1.Appearance.HeaderPanel.Options.UseTextOptions = true;
bandedGridView1.Appearance.HeaderPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap; 
See Also