Skip to main content
Tab

ValidationSettings.ValidationGroup Property

Gets or sets the name of a validation group to which the editor belongs.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

[DefaultValue("")]
public string ValidationGroup { get; set; }

Property Value

Type Default Description
String String.Empty

A string value that specifies the name of a validation group.

Property Paths

You can access this nested property as listed below:

Object Type Path to ValidationGroup
ASPxEdit
.ValidationSettings .ValidationGroup
EditProperties
.ValidationSettings .ValidationGroup

Remarks

Validation groups allow you to assign validation editors 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 the current editor.

When the ValidationSettings.CausesValidation property is set to true, the ValidationGroup property specifies a validation group that is validated when the editor posts back to the server. If you do not specify a value for this property and the ValidationSettings.CausesValidation property is set to true, all validation controls on the page that are not assigned to a validation group are validated when the editor posts back to the server.

In order to validate a group of input controls on the client, you can use the following client methods: ASPxClientEdit.ValidateGroup, ASPxClientEdit.ValidateEditorsInContainer, ASPxClientEdit.ValidateEditorsInContainerById.

Online Example

View Example: How to raise validation on the client

Example

View Example

<dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="200px" View="GroupBox" HeaderText="ValidationGroup = 'MyGroup'">
    <PanelCollection>
        <dx:PanelContent ID="PanelContent1" runat="server">  
            <dx:ASPxTextBox ID="tbTextBox3" runat="server" Width="170px" Style="margin-bottom: 4px;">
                <ValidationSettings ValidationGroup="MyGroup" ErrorText="Field is required." validateonleave="False">
                    <RequiredField IsRequired="True" ErrorText="" />
                </ValidationSettings>
            </dx:ASPxTextBox>
            <dx:ASPxTextBox ID="tbTextBox4" runat="server" Width="170px">
                <ValidationSettings ValidationGroup="MyGroup" ErrorText="Field is required." validateonleave="False">
                    <RequiredField IsRequired="True" ErrorText="" />
                </ValidationSettings>
            </dx:ASPxTextBox>
            <br />
            <input type="button" value="Validate Group" onclick="ASPxClientEdit.ValidateGroup('MyGroup');" />
        </dx:PanelContent>
    </PanelCollection>
    <HeaderStyle Font-Size="9pt" />
</dx:ASPxRoundPanel>
See Also