Back to Devexpress

GridOptionsView.AllowHtmlDrawDetailTabs Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-gridoptionsview-86952c24.md

latest5.9 KB
Original Source

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.v25.2.dll

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

Declaration

csharp
[DefaultValue(false)]
[XtraSerializableProperty]
public virtual bool AllowHtmlDrawDetailTabs { get; set; }
vb
<DefaultValue(False)>
<XtraSerializableProperty>
Public Overridable Property AllowHtmlDrawDetailTabs As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

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

|

Property Paths

You can access this nested property as listed below:

Object TypePath to 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.

csharp
// 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"];
    }
}
vb
' Use the master view to enable HTML tags and specify an image collection.
advBandedGridView1.OptionsView.AllowHtmlDrawDetailTabs = True
advBandedGridView1.HtmlImages = svgImageCollection1

Private Sub advBandedGridView1_DetailTabStyle(ByVal sender As Object, ByVal e As DetailTabStyleEventArgs)
    If Equals(e.Caption, "Products") Then
        e.Caption = "Products <image=product;size=16,16>"
    End If

    If Equals(e.Caption, "Category") Then
        e.Appearance.Header.ForeColor = DevExpress.LookAndFeel.DXSkinColors.FillColors.Success
        e.ImageOptions.SvgImage = svgImageCollection1("category")
    End If
End Sub

See Also

DetailTabStyle

ShowDetailTabs

GridOptionsView Class

GridOptionsView Members

DevExpress.XtraGrid.Views.Grid Namespace