How to get the count of selected items in Kendo Multi Select Control?

12,292

Solution 1

using multiSelect.value() will give you an array of the selected items. You can then get the .length off the array:


var count = multiSelect.value().length;

http://docs.kendoui.com/api/web/multiselect#methods-value

and

https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Array/length

Solution 2

It might help to others

var multiSelectItems = $('#MultiselectCollection').data('kendoMultiSelect');
var count = multiSelectItems .value().length;
Share:
12,292
Rodney Hickman
Author by

Rodney Hickman

Highly Motivated and Experienced IT Professional with Expert Proficiency in Mobile and Web Development. Technical Talent and Business Expertise Transferable to Management-Level Positions Across Industries. Comprehensive understanding of the software development life cycle (SDLC) from requirements and technical specification definition to application design, development, and implementation. Regarded for the ability to drive processes and motivate cross-functional teams; works well under pressure to manage and meet multiple project deadlines. Objective and progressive with dynamic leadership, technical, and business acumen. Specialties IT Software Management, Staff Leadership and Development, Project Management, Business / Technical Requirements Development, Process Improvement / Cost Reduction, Client Relationship Management, Website Architect & Design, SDLC, Business Process Management Systems, Information Architecture, Responsive Design, C#, ASP .Net, MVC, SQL, Entity Framework, Object Oriented Design and Programming (OOD, OOP), Agile with Scrum

Updated on July 25, 2022

Comments

  • Rodney Hickman
    Rodney Hickman almost 2 years

    What is the best way to get the count of selected Items in the Kendo multi select control?

    I've tried:

    multiSelect.dataItems().count()
    

    and

    multiSelect.value().count()
    

    and neither work? Any suggestions would be greatly appreciated.

  • Jon
    Jon over 8 years
    if you're doing serverfiltering AND serverPaging, then the value() does't return the correct items. It will only count what's on the DOM!!!