ASP.NET AJAX Autocomplete duplicate selection issue

4 posts, 0 answers
  1. jagadish
    jagadish avatar
    2 posts
    Member since:
    Aug 2010

    Posted 15 Jul 2015 Link to this post

    In autocomplete textbox i am able to select same item multiple times, how can i avoid selecting same item multiple times.


    1. Autocomplete shows list of fruits

    2. I will select Apple.

    3. Next again i will select apple


    Now apple is selected 2 times, this is a problem.

    How to avoid this?

    Please help me in this regard.

    Thanks for your cooperation in advance.



    Jagadish Konnur

  2. Aneliya Petkova
    Aneliya Petkova avatar
    207 posts

    Posted 17 Jul 2015 Link to this post

    Hi Jagadish,

    I checked the support ticket that you sent and will also paste the answer here in case anyone else is interested in it:

    I would suggest you to use the client-side OnClientEntryAdding event and in its handler to check whether there is an entry with the same text and value in the RadAutoCompleteBox input already. So if there is such entry, you can cancel this event using eventArgs.set_cancel(true); Thus this item will not be added to the entries collection again.

    Please check our help articles for additional information:

    Aneliya Petkova
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Pierre
    Pierre avatar
    57 posts
    Member since:
    Jun 2016

    Posted 15 Jun 2017 in reply to Aneliya Petkova Link to this post

    "I will also paste the answer here in case anyone else is interested in it"

    Where is it ?

  4. Sam
    Sam avatar
    2 posts
    Member since:
    Feb 2011

    Posted 11 Jul 2017 Link to this post

    function TestMulti(sender, args) {
                var entries = sender.get_entries();
                for (var i = 0; i < entries.get_count() ; i++) {
                    if (entries.getEntry(i).get_value() == args.get_entry().get_value()) {
Back to Top