Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions _contentTemplates/common/form-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ The Telerik Blazor validation tools let you match the style of your validation m
#note-editcontext-formitem-template
> When using the [Form `EditContext` parameter](slug:form-overview#creating-blazor-form) together with [validation components](slug:validation-tools-overview) or [Form item `<Template>`s](slug:form-formitems-template), make sure to create the `EditContext` from the model instance, which is used by the validation components and inside the Form item templates. Otherwise, the Form will not update the correct object instance and validation will not work as expected.
#end

#note-fluentvalidation
> Although `Blazored.FluentValidation` was deprecated, the following example uses it, because the package is still more popular that its alternatives. Telerik does not endorse any particular third-party validator. From Telerik API perspective, the integration is the same with any validator.
#end
2 changes: 2 additions & 0 deletions components/form/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ The example below:
* Requires the [`Blazored.FluentValidation` NuGet package](https://www.nuget.org/packages/Blazored.FluentValidation). Also refer to the [FluentValidation documentation](https://docs.fluentvalidation.net/en/latest/blazor.html).
* Shows how to pass `ValueExpression` from a parent component to optional custom child components in a [Form item template](slug:form-formitems-template) or a [Grid editor template](slug:grid-templates-editor). If the `ValueExpression` is not passed correctly, the app will throw [exception similar to: `Cannot validate instances of type 'ComponentName'. This validator can only validate instances of type 'ModelClassName'`](slug:form-kb-fluent-validation-cannot-validate-instances-of-type).

@[template](/_contentTemplates/common/form-validation.md#note-fluentvalidation)

>caption Using FluentValidation

````RAZOR Home.razor
Expand Down
2 changes: 2 additions & 0 deletions components/grid/editing/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ The example below shows how to:

Install the [`Blazored.FluentValidation`](https://www.nuget.org/packages/Blazored.FluentValidation) NuGet package to run the following code and refer to the [FluentValidation documentation](https://docs.fluentvalidation.net/en/latest/built-in-validators.html).

@[template](/_contentTemplates/common/form-validation.md#note-fluentvalidation)

>caption Use Telerik Grid for Blazor with FluentValidation

````RAZOR.skip-repl
Expand Down
2 changes: 2 additions & 0 deletions components/treelist/editing/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ The example below shows how to:

Install the [`Blazored.FluentValidation`](https://www.nuget.org/packages/Blazored.FluentValidation) NuGet package to run the following code and refer to the [FluentValidation documentation](https://docs.fluentvalidation.net/en/latest/built-in-validators.html).

@[template](/_contentTemplates/common/form-validation.md#note-fluentvalidation)

>caption Use Telerik TreeList for Blazor with FluentValidation

````RAZOR.skip-repl
Expand Down
Loading