LayoutItemBase.Caption Property
Gets or sets the current layout item caption.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v20.2.dll
NuGet Package: DevExpress.Web
Declaration
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.