Can I use AutoComplete within ListView?

0 Answers 48 Views
AutoComplete ListView
Rod
Top achievements
Rank 1
Rod asked on 19 Aug 2022, 03:04 PM

We're still getting used to using Telerik's Kendo UI for jQuery. So far, we've only used one component, AutoComplete. Which works great, BTW!

There's something we'd like to do, but don't know how to do. On an ASP.NET MVC Core page (.NET 6) we want to be able to allow the user to enter multiple items of the same type. It seems like either the Grid or ListView Kendo components would work. Personally, I'm favoring the ListView. But we also need to use AutoComplete work when the user is entering values to a new row. So, for example, we need to collect LotNumber and ProgramName, multiple times, because there can be and often is, multiple items to be entered, along with other details on the same page. I've looked at the ListView component, the Add method, etc. In the example given, it references an identified (by using the HTML id property) control on the page. So, how does one apply AutoComplete to both LotNumber and ProgramName, when entering a new LotNumber/ProgramName pair in a ListView?

Neli
Telerik team
commented on 24 Aug 2022, 09:14 AM

Hi Rod,

I would suggest handling the edit event of the ListView. In the event handler, you can find the needed input by id or attribute and initialize the AutoComplete widget.

 edit: function(e){
        $('[name="name"]').kendoAutoComplete({
            dataSource: {
              data: ["John", "Michael", "Tom", "Alex", "Peter"]
            }
        });
},

Here you will find a small example demonstrating the above.

I hope this helps.

Regards,

Neli

No answers yet. Maybe you can help?

Tags
AutoComplete ListView
Asked by
Rod
Top achievements
Rank 1
Share this question
or