ButtonSettings.ValidationGroup Property

Gets or sets the group of inputs that are validated when the button is clicked.

Namespace: DevExpress.Web.Mvc

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

Declaration

public string ValidationGroup { get; set; }

Property Value

Type Description
String

A string value that specifies the group of inputs that are validated when the button is clicked.

Remarks

Validation groups allow you to assign validation controls on a page to a specific category. Each validation group can be validated independently from other validation groups on the page. Use the ValidationGroup property to specify the name of the validation group for which the button forces validation, when clicked.

This property has effect only when the ButtonSettings.CausesValidation property is set to true. When you specify a value for the ValidationGroup property, only the validation controls that are part of the specified group are validated when the button is clicked. If you do not specify a value for this property and the ButtonSettings.CausesValidation property is set to true, all verifiable controls on the page that are not assigned to a validation group are validated, when the button is clicked.

The functionality of the ValidationGroup property is affected by whether or not the ButtonSettings.ValidationContainerID property is assigned. The possible cases of synergy between these two properties are listed below.

  • If only the ValidationGroup property is assigned, all controls belonging to the specified validation group are validated.
  • If only the ValidationContainerID property is assigned, all controls in the specified container are validated except for controls with assigned validation groups.
  • If both properties are assigned, only controls belonging to the specified validation group are validated within the specified container.
  • If both properties are unassigned, all editors not belonging to any validation group are validated.

Note that a group of inputs can also be validated on the client by using the following client static methods: ASPxClientEdit.ValidateGroup, ASPxClientEdit.ValidateEditorsInContainer, ASPxClientEdit.ValidateEditorsInContainerById.

See Also