Skip to main content
A newer version of this page is available. .

GridOptionsView.AllowHtmlDrawHeaders Property

Gets or sets whether HTML formatting can be applied to column and band captions.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v19.1.dll

Declaration

[DefaultValue(false)]
[XtraSerializableProperty]
public virtual bool AllowHtmlDrawHeaders { get; set; }

Property Value

Type Default Description
Boolean **false**

true if HTML formatting can be applied to column and band captions; otherwise, false.

Property Paths

You can access this nested property as listed below:

Object Type Path to AllowHtmlDrawHeaders
AdvBandedGridView
.OptionsView.AllowHtmlDrawHeaders
BandedGridView
.OptionsView.AllowHtmlDrawHeaders
GridView
.OptionsView.AllowHtmlDrawHeaders

Remarks

If the 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.

AllowHtmlDrawHeaders

 

Note

  • Hints don’t support HTML formatting. They display plain text without tags.

Example

The following example shows how to display an image to the right of the Customer column’s caption using HTML tags. The HTML formatting feature is enabled via the GridOptionsView.AllowHtmlDrawHeaders property.

HtmlImages-In-ColumnHeader

string imageName = "customer";
imageCollection1.AddImage(Image.FromFile("c:\\customer-16x16.png"), imageName);

gridView1.OptionsView.AllowHtmlDrawHeaders = true;
gridView1.HtmlImages = imageCollection1;
columnCustomer.Caption = columnCustomer.GetCaption() + "<image=" + imageName + ">";

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; 

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AllowHtmlDrawHeaders 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.

See Also