-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASP.NET Core DataGrid: update Validation demo description (#3195)
- Loading branch information
1 parent
cca333c
commit 07830ec
Showing
1 changed file
with
5 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
The DataGrid UI component supports data validation against a set of predefined or custom validation rules. These rules are generated based on Data Annotations that decorate the model properties (see the _EmployeeValidation.cs_ file). For the validation to work, the DataGrid should be cast to the model type and its columns should be declared using the `AddFor()` method. | ||
The DataGrid UI component supports data validation against a set of predefined or custom validation rules. These rules are generated based on Data Annotations that decorate the model properties (see the _EmployeeValidation.cs_ file). For the validation to work, the DataGrid should be cast to the model type and its columns should be declared using the `AddFor()` method. | ||
|
||
The [AdditionalFields](https://learn.microsoft.com/en-us/aspnet/core/mvc/models/validation?view=aspnetcore-8.0#additional-fields) property of the Remote attribute allows you validate combinations of fields against data on the server. | ||
|
||
In this demo, the data validation process will not be successfully completed if an already existing email is entered. To accomplish that, apply a Remote attribute to Email and include ID in AdditionalFields. The validation parameter will then have access to both ID and Email, which allows you to compare them with source data. |