Skip to main content

CardViewSettings.SetEditFormTemplateContent(Action<CardViewEditFormTemplateContainer>) Method

Allows you to specify an edit form template.

Namespace: DevExpress.Web.Mvc

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

Declaration

public void SetEditFormTemplateContent(
    Action<CardViewEditFormTemplateContainer> contentMethod
)

Parameters

Name Type Description
contentMethod Action<CardViewEditFormTemplateContainer>

A method to which a template content rendering is delegated.

Remarks

When you call the SetEditFormTemplateContent method, the control creates a template within a container object of the CardViewEditFormTemplateContainer type.

var cardView = Html.DevExpress().CardView(settings => {
    settings.Name = "CardView";
    settings.CallbackRouteValues = new { Controller = "Home", Action = "CardViewPartial" };
    ...
    settings.SetEditFormTemplateContent(c => {
        Html.DevExpress().TextBox(tbSettings => {
            tbSettings.Name = "TextBox";
            tbSettings.Properties.NullText = "TEST";
        }).Render();

        Html.RenderAction("GridViewPartial");
    });
    ...
}
@cardView.Bind(Model).GetHtml()

View Example: A simple implementation of FormLayout inside EditFormTemplate

See Also