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.
See Also