Back to Devexpress

ValidationSettings.CausesValidation Property

aspnet-devexpress-dot-web-dot-validationsettings-81b54258.md

latest5.3 KB
Original Source

ValidationSettings.CausesValidation Property

Gets or sets a value that specifies whether validation is performed when the editor is set to validate when a postback occurs.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(false)]
public bool CausesValidation { get; set; }
vb
<DefaultValue(False)>
Public Property CausesValidation As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true if validation is performed when the editor is set to validate when a postback occurs; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to CausesValidation
ASPxEdit

.ValidationSettings .CausesValidation

| | EditProperties |

.ValidationSettings .CausesValidation

|

Remarks

If the CausesValidation and ASPxEdit.AutoPostBack properties are set to true, the validation of the editor forces a whole group (specified via the ValidationSettings.ValidationGroup property) validation.

Online Example

View Example: How to raise validation on the client

Example

View Example

aspx
<dx:ASPxComboBox ID="cbComboBox2" runat="server" AutoPostBack="True">
    <Items>
        <dx:ListEditItem Value="" Text="(Empty)" />
        <dx:ListEditItem Value="Some value" Text="Some value" />
    </Items>                    
    <ValidationSettings CausesValidation="True" ValidationGroup="CausesValidationDemoGroup">
        <RequiredField IsRequired="True" ErrorText="Select not empty value." />
    </ValidationSettings>
</dx:ASPxComboBox>


<dx:ASPxComboBox ID="cbComboBox3" runat="server" AutoPostBack="True">
    <Items>
        <dx:ListEditItem Value="" Text="(Empty)" />
        <dx:ListEditItem Value="Some value" Text="Some value" />
    </Items>                    
    <ValidationSettings CausesValidation="True" ValidationGroup="CausesValidationDemoGroup">
        <RequiredField IsRequired="True" ErrorText="Select not empty value." />
    </ValidationSettings>
</dx:ASPxComboBox>


<dx:ASPxComboBox ID="ASPxComboBox2" runat="server" AutoPostBack="True">
    <Items>
        <dx:ListEditItem Value="" Text="(Empty)" />
        <dx:ListEditItem Value="Some value" Text="Some value" />
    </Items>                    
    <ValidationSettings CausesValidation="True" ValidationGroup="CausesValidationDemoGroup">
        <RequiredField IsRequired="True" ErrorText="Select not empty value." />
    </ValidationSettings>
</dx:ASPxComboBox>
aspx
<dx:ASPxComboBox ID="cbComboBox2" runat="server" AutoPostBack="True">
    <Items>
        <dx:ListEditItem Value="" Text="(Empty)" />
        <dx:ListEditItem Value="Some value" Text="Some value" />
    </Items>                    
    <ValidationSettings CausesValidation="True" ValidationGroup="CausesValidationDemoGroup">
        <RequiredField IsRequired="True" ErrorText="Select not empty value." />
    </ValidationSettings>
</dx:ASPxComboBox>


<dx:ASPxComboBox ID="cbComboBox3" runat="server" AutoPostBack="True">
    <Items>
        <dx:ListEditItem Value="" Text="(Empty)" />
        <dx:ListEditItem Value="Some value" Text="Some value" />
    </Items>                    
    <ValidationSettings CausesValidation="True" ValidationGroup="CausesValidationDemoGroup">
        <RequiredField IsRequired="True" ErrorText="Select not empty value." />
    </ValidationSettings>
</dx:ASPxComboBox>


<dx:ASPxComboBox ID="ASPxComboBox2" runat="server" AutoPostBack="True">
    <Items>
        <dx:ListEditItem Value="" Text="(Empty)" />
        <dx:ListEditItem Value="Some value" Text="Some value" />
    </Items>                    
    <ValidationSettings CausesValidation="True" ValidationGroup="CausesValidationDemoGroup">
        <RequiredField IsRequired="True" ErrorText="Select not empty value." />
    </ValidationSettings>
</dx:ASPxComboBox>

See Also

Validation

How to: Validate a Group of Editors

ValidationSettings Class

ValidationSettings Members

DevExpress.Web Namespace