Back to Devexpress

GridBand.Caption Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-bandedgrid-dot-gridband-76ac91b5.md

latest3.5 KB
Original Source

GridBand.Caption Property

Gets or sets the band’s caption.

Namespace : DevExpress.XtraGrid.Views.BandedGrid

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DefaultValue("")]
[DXCategory("Appearance")]
[XtraSerializableProperty]
public virtual string Caption { get; set; }
vb
<DXCategory("Appearance")>
<DefaultValue("")>
<XtraSerializableProperty>
Public Overridable Property Caption As String

Property Value

TypeDefaultDescription
StringString.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:

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

bandedGridView1.OptionsView.AllowHtmlDrawHeaders = true;
bandedGridView1.Appearance.HeaderPanel.Options.UseTextOptions = true;
bandedGridView1.Appearance.HeaderPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
vb
gridBand1.Caption = "Production
<b>costs</b>"

bandedGridView1.OptionsView.AllowHtmlDrawHeaders = True
bandedGridView1.Appearance.HeaderPanel.Options.UseTextOptions = True
bandedGridView1.Appearance.HeaderPanel.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap

See Also

CustomizationCaption

AllowHtmlDrawHeaders

GetTextCaption()

AllowMultilineHeaders

HTML-inspired Text Formatting

GridBand Class

GridBand Members

DevExpress.XtraGrid.Views.BandedGrid Namespace