Skip to main content

MVCxFormLayoutItem.SetNestedContent(Action) Method

Allows you to define the FormLayout item’s nested content.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v24.1.dll

NuGet Package: DevExpress.Web.Mvc5

Declaration

public void SetNestedContent(
    Action method
)

Parameters

Name Type Description
method Action

A method to which content rendering is delegated.

Remarks

The code sample below demonstrates how to use the SetNestedContent method to define the item’s content.

View code:

@Html.DevExpress().FormLayout(
    settings =>
    {
        settings.Name = "myFormLayout";
        ...
        //Adding a layout item with the third-party editor and custom HTML 
        settings.Items.Add(i =>
        {
            i.SetNestedContent(() =>
            {
                ViewContext.Writer.Write("<div class=\"divWithStandardTextBox\">");
                ViewContext.Writer.Write(Html.TextBoxFor(m => m.Id));
                ViewContext.Writer.Write("</div>");
            });
        });
    }
).GetHtml()
See Also