How to update text field when drop down changes

1 Answer 161 Views
DropDownList
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Tim asked on 08 Dec 2022, 10:09 PM

I have a page with several TelerikDropDownList controls with Yes and No options, and an associated text field for notes underneath each one.

If the user selects the Yes option, I want to remove any notes in the associated text field.

Is this possible? I know about ValueChanged, but only the value is passed to the function.

Within the ValueChanged I can't figure out how to get a reference to the TelerikDropDownList that initiated the event and its associated text field.

Thanks

1 Answer, 1 is accepted

Sort by
1
Accepted
Marin Bratanov
Telerik team
answered on 08 Dec 2022, 10:53 PM

Hello Tim,

In Blazor, you change the data in the view-model, not through the component reference.

So, an event of the dropdown (ValueChanged or OnChange) lets you capture the user action, and then you simply have to alter the value of the field the text input is bound to.

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tim
Top achievements
Rank 3
Iron
Iron
Iron
commented on 09 Dec 2022, 02:31 PM

That makes sense. Thank you.

Tags
DropDownList
Asked by
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Marin Bratanov
Telerik team
Share this question
or