New to Kendo UI for jQuery? Download free 30-day trial

Change Multiselect Tag Mode Based on the Number of Selected Items


Product Progress® Kendo UI® MultiSelect for jQuery
Operating System Windows 10 64bit
Browser Google Chrome
Browser Version 61.0.3163.100 (Official Build) (64-bit)


How can I set the multiple tag mode of the MultiSelect for the first X number of selected items and switch the tag mode to single if the user selects more than X items?


  1. To get the current count of selected items, handle the change event of the MultiSelect.
  2. If the current count exceeds the predefined number, change the tag mode through the setOptions method of the MultiSelect.
<select id="multiselect">
    $(document).ready(function(e) {
            dataSource: ["Item1", "Item2", "Item3", "Item4"],
            value: ["Item2", "Item3"],
            tagMode: "multiple",
            change: function() {
                var selectedValues = this.value();
                var currentTagMode = this.options.tagMode;
                var newTagMode = currentTagMode;
                if (selectedValues.length <= 2) {
                    newTagMode = "multiple";
                } else {
                    newTagMode = "single"
                if (newTagMode != currentTagMode) {
                        tagMode: newTagMode


In this article