All docs
V18.2
20.2 (EAP/Beta)
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
18.1
17.2

Overview - ValidationSummary

ValidationSummary is an extension that allows you to summarize validation errors from multiple data editors.

Implementation Details

ValidationSummary is realized by the ValidationSummaryExtension class. Its instance can be accessed via the ExtensionsFactory.ValidationSummary helper method, which is used to add a ValidationSummary extension to a view. This method's parameter provides access to the ValidationSummary's settings implemented by the ValidationSummarySettings class, allowing you to fully customize the extension.

The ValidationSummary's client counterpart is represented by the ASPxClientValidationSummary object.

Declaration

ValidationSummary can be added to a view in the following manner.

@using (@Html.BeginForm()) { 
    @Html.DevExpress().ValidationSummary().GetHtml()
    <table>
        <tr>
            <td>@Html.DevExpress().LabelFor(model => model.FirstName).GetHtml()</td>
            <td>@Html.DevExpress().TextBox(
                settings => {
                    settings.Name = "FirstName";
                    settings.ShowModelErrors = true;
                    settings.Properties.ValidationSettings.Display = Display.None;
                }).Bind(Model.FirstName).GetHtml()</td>
        </tr>
    ...
    </table>
...
}

The code result is demonstrated in the image below.

MVC_Validation_DXValidationSummary

See Also