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
Copy file name to clipboardExpand all lines: knowledge-base/inputs-validation-child-component.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ page_title: Validate a Telerik component as child component and apply invalid bo
6
6
slug: inputs-kb-validate-child-component
7
7
position:
8
8
tags: telerik, blazor, form, validation
9
-
ticketid: 1499665
9
+
ticketid: 1499665, 1697034
10
10
res_type: kb
11
11
---
12
12
@@ -39,9 +39,9 @@ I am wrapping a Telerik component inside a custom component in my Form. When I t
39
39
40
40
Internally, the Telerik input components use the cascading `EditContext` parameter that the `EditForm` and `TelerikForm` provide. The `EditContext` API allow the components to determine if validation has passed or failed. If the validation fails, the components show a red border.
41
41
42
-
When you wrap an input component in another component, you must define a `ValueExpression` parameter in the custom component. This will allow the custom component to receive the correct expression from the parent component, which holds the Form. The Blazor framework generates the expression automatically when using `@bind-Value`, but not when there is another component in the component hierarchy tree.
42
+
When you wrap an input component in a custom child component, you must define a `ValueExpression` parameter for the child component. This allows the child component to receive the correct expression from the parent component, which holds the Form. The Blazor framework generates the expression automatically when using `@bind-Value`, but not when there is another component in the component hierarchy tree.
43
43
44
-
The example below shows how to wrap a Telerik TextBox and DropDownList in different `.razor` files and get the invalid red border when the validation does not pass.
44
+
The example below shows how to wrap a Telerik TextBox and DropDownList in different `.razor` files and get the invalid red border when the validation does not pass. Note the different `For` parameter syntax in the two `<TelerikValidationMessage />` instances in `Home.razor` and `DropDownList.razor`. The `For` syntax depends on whether the `TelerikValidationMessage` component is in the same component as the Form, or in a child component, which consumes a `ValueExpression` parameter.
45
45
46
46
>caption Validate a TextBox and a DropDownList in custom components with ValueExpression parameters
47
47
@@ -63,6 +63,7 @@ The example below shows how to wrap a Telerik TextBox and DropDownList in differ
0 commit comments