You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The datagrid ValidationsHandlerType does not appear to be respected when set to FluentValidationHandler. The validation handler type defined on a DataGrid is not used when validating columns during edit/create flows. Specifically this prevents the use of FluentValidationHandler on the top-level datagrid.
Expected behavior
The validations in EmployeeValidator are checked over the data before saving, or while editing.
Screenshots
Data grid allows saving an employee with no name, when a FluentValidator is defined to explicitly deny this:
Additional context
I believe the ValidationsHandlerType is completely ignored in this use case. In this revision of the code , we set ValidationsHandlerType="typeof(TestValidationHandler)". TestValidationHandler throws an exception on all methods, but no exceptions are thrown when running the app. And a breakpoint set in TestValidationHandler will not be hit.
This may be intentional, but the documentation implies it is not, as I have not overriden the HandlerType anywhere else in the code:
Attributes
DataGrid
Name
Description
ValidationsHandlerType
Defines the default handler type that will be used by the validation, unless it is overriden by Validation.HandlerType property.
The text was updated successfully, but these errors were encountered:
Describe the bug
The datagrid
ValidationsHandlerType
does not appear to be respected when set to FluentValidationHandler. The validation handler type defined on a DataGrid is not used when validating columns during edit/create flows. Specifically this prevents the use of FluentValidationHandler on the top-level datagrid.To Reproduce
minimal code example:
https://github.com/dsmiller95/data-grid-fluent-validation-example/blob/fe93ed4ac1a4211a3ab490f1f4d8946a789a801f/DataGridFluentValidation/Pages/DataGridPage.razor
Steps to reproduce the behavior:
ValidationsHandlerType="typeof(FluentValidationHandler)"
EmployeeValidator : AbstractValidator<Employee>
Expected behavior
The validations in EmployeeValidator are checked over the data before saving, or while editing.
Screenshots
Data grid allows saving an employee with no name, when a FluentValidator is defined to explicitly deny this:
Additional context
I believe the
ValidationsHandlerType
is completely ignored in this use case. In this revision of the code , we setValidationsHandlerType="typeof(TestValidationHandler)"
.TestValidationHandler
throws an exception on all methods, but no exceptions are thrown when running the app. And a breakpoint set inTestValidationHandler
will not be hit.This may be intentional, but the documentation implies it is not, as I have not overriden the HandlerType anywhere else in the code:
Attributes
DataGrid
The text was updated successfully, but these errors were encountered: