Skip to main content
A newer version of this page is available. .
All docs
V21.1

GridOptionsView.AllowHtmlDrawDetailTabs Property

Gets or sets whether to parse HTML-inspired tags in tab captions. This option must be applied to the master view.

Namespace: DevExpress.XtraGrid.Views.Grid

Assembly: DevExpress.XtraGrid.v21.1.dll

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

Declaration

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

Property Value

Type Default Description
Boolean **false**

true to parse HTML-tags in tab captions; otherwise, false.

Property Paths

You can access this nested property as listed below:

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

Remarks

A detail view’s ViewCaption property allows you to specify a caption that is displayed in a detail tab. Ensure that the ShowDetailTabs option is enabled; otherwise, tabs are not displayed. If the EnableDetailToolTip option is enabled, this caption is also displayed in detail tooltips.

If the caption is not specified, the detail view uses the LevelName property value.

HTML-Formatted Tab Captions

You can enable the master view’s AllowHtmlDrawDetailTabs option to parse HTML-inspired tags in detail tab captions.

Custom Images and Appearance Settings for Individual Detail Tabs

The DetailTabStyle event fires for each detail view. This event allows you to assign a custom image to the processed tab and apply custom appearance settings to the tab caption.

Use the Caption event argument to obtain or change the processed tab caption. The following arguments allow you to specify the tab style:

  • Appearance — provides access to background and foreground colors, font style, and so forth.
  • ImageOptions — provides access to a raster or vector image assigned to the tab.

You can also use the IsSelected argument to apply a specific style depending on whether the tab is selected.

The RefreshDetailTab(Int32) method allows you to update a detail tab at runtime.

Example

The code below uses HTML-inspired tags to insert an image in a tab. In the figure below, an icon is displayed to the right of the Products tab caption.

HTML Formatting in Detail Tabs

// Use the master view to enable HTML tags and specify an image collection.
advBandedGridView1.OptionsView.AllowHtmlDrawDetailTabs = true; 
advBandedGridView1.HtmlImages = svgImageCollection1;

void advBandedGridView1_DetailTabStyle(object sender, DetailTabStyleEventArgs e) {
    if (e.Caption == "Products") {
        e.Caption = "Products <image=product;size=16,16>";
    }
    if (e.Caption == "Category") {
        e.Appearance.Header.ForeColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Success;
        e.ImageOptions.SvgImage = svgImageCollection1["category"];
    }
}
See Also