How to clear drop down list selection in kendo UI for angular 2?

1 Answer 5899 Views
DropDownList
Huy
Top achievements
Rank 1
Huy asked on 01 Dec 2016, 09:35 PM

How do you clear (reset) DropDownList selection in kendo UI for angular 2?

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 02 Dec 2016, 08:21 AM
Hello,

The selection in the DropDownlist represents the current value of the component, so you can just clear out the value and it will reset the selection. Check this plunkr:

http://plnkr.co/edit/lL4Km8aH6mGc2Wo0N0Lp?p=preview

Regards,
Kiril Nikolov
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Huy
Top achievements
Rank 1
commented on 02 Dec 2016, 03:25 PM

Thank you very much for your help. But when I did that the clear button only works for the first click, when I re-select an option in the Dropdownlist and clear the Dropdownlist again, it won't clear the selection. Do you have any idea?

Thank you

Huy Nguyen

Huy
Top achievements
Rank 1
commented on 02 Dec 2016, 03:38 PM

I figured it out. It has to be 2-way binding.

<kendo-dropdownlist [data]="listItems" [(value)]="value"><br></kendo-dropdownlist>

 

Thank you.

Kiril Nikolov
Telerik team
commented on 05 Dec 2016, 08:46 AM

Hello,

Happy to hear that the issues is resolved.

In case you have any further questions - do not hesitate to contact us.

Regards,
Kiril Nikolov
Telerik by Progress
Kendo UI is ready for Visual Studio 2017 RC! Learn more.
Sully
Top achievements
Rank 1
commented on 26 Aug 2019, 10:37 PM

OMG - I've been going crazy with this.  The 2-way binding fixed it.  Bless You!
Tags
DropDownList
Asked by
Huy
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or