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

LayoutItemBase.Caption Property

Gets or sets the current layout item caption.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.2.dll

NuGet Package: DevExpress.Web

Declaration

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

Property Value

Type Default Description
String String.Empty

A String value that specifies the text content of the current layout item’s caption.

Remarks

Note that when a single item is embedded directly to the TabbedLayoutGroup its caption is not displayed by default, because it matches the TabbedLayoutGroup caption and it does not make sense to display two identical captions. To display the item caption, wrap the editor item to the LayoutGroup container with the required caption.

Web Forms approach:

<dx:TabbedLayoutGroup ClientInstanceName="tabbedGroupPageControl" Width="100%">
    <Items>
        <dx:LayoutGroup Caption="TestGroup">
            <Items>
                ...
            </Items>
        </dx:LayoutGroup>
    </Items>
</dx:TabbedLayoutGroup>

MVC approach:

@Html.DevExpress().FormLayout(set => {
    set.Name = "FormLayout";
    set.Items.AddTabbedGroupItem(groupSettings => {
        groupSettings.Name = "group";
        groupSettings.Items.AddGroupItem(g => {
            g.Caption = "TestGroup";
            g.Items.Add(item => {
                item.NestedExtensionType = FormLayoutNestedExtensionItemType.TextBox;
                item.Name = item.Caption = "Test Description";
                item.SetNestedContent(() => {

                Html.DevExpress().TextBox(tb => {
                    tb.Name = "Test Description";
                    tb.ShowModelErrors = true;
                }).Bind(Model.Description).Render();
            });
        });
    });
});
}).GetHtml();

Note

The ASPxFormLayout.EncodeHtml property is not in effect for the Caption property. So the Caption property value is not HTML encoded and is rendered as pure HTML markup.

Refer to the HTML Encoding topic for more information.

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