aspnet-devexpress-dot-web-dot-layoutitembase.md
Gets or sets the current layout item caption.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
[DefaultValue("")]
public virtual string Caption { get; set; }
<DefaultValue("")>
Public Overridable Property Caption As String
| Type | Default | Description |
|---|---|---|
| String | String.Empty |
A String value that specifies the text content of the current layout item’s caption.
|
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();
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.
void Localize() {
appointmentFormMainLayout.FindItemOrGroupByName("itemSubject").Caption = ASPxSchedulerLocalizer.GetString(ASPxSchedulerStringId.Form_Subject);
appointmentFormMainLayout.FindItemOrGroupByName("itemLocation").Caption = ASPxSchedulerLocalizer.GetString(ASPxSchedulerStringId.Form_Location);
Private Sub Localize()
appointmentFormMainLayout.FindItemOrGroupByName("itemSubject").Caption = ASPxSchedulerLocalizer.GetString(ASPxSchedulerStringId.Form_Subject)
appointmentFormMainLayout.FindItemOrGroupByName("itemLocation").Caption = ASPxSchedulerLocalizer.GetString(ASPxSchedulerStringId.Form_Location)
See Also