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

5 posts, 1 answers
  1. Huy
    Huy avatar
    4 posts
    Member since:
    Feb 2016

    Posted 01 Dec 2016 Link to this post

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

    Thanks

  2. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2598 posts

    Posted 02 Dec 2016 Link to this post

    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.
  3. Huy
    Huy avatar
    4 posts
    Member since:
    Feb 2016

    Posted 02 Dec 2016 in reply to Kiril Nikolov Link to this post

    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

  4. Huy
    Huy avatar
    4 posts
    Member since:
    Feb 2016

    Posted 02 Dec 2016 in reply to Kiril Nikolov Link to this post

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

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

     

    Thank you.

  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2598 posts

    Posted 05 Dec 2016 Link to this post

    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.
Back to Top