Completed
Last Updated: 25 Mar 2021 12:08 by ADMIN
IT
Created on: 18 Jun 2013 16:55
Category: DropDownList
Type: Feature Request
62
Option to disable multiselect items
Check out this idea. It may help solve this issue and help with UI presentation.
http://feedback.kendoui.com/forums/127393-kendo-ui-feedback/suggestions/3767009-treeview-in-combobox

Admin edit: A Knowledge Base article that shows how you can achieve this: https://docs.telerik.com/kendo-ui/knowledge-base/disable-multiselect-items

14 comments
ADMIN
Marin Bratanov
Posted on: 28 Nov 2018 15:43
Hi all,
In the meantime, the following article demonstrates the general approach you can use to implement this: (Edit: updated link to a more specific resource): https://docs.telerik.com/kendo-ui/knowledge-base/disable-multiselect-items
Patrick
Posted on: 07 Aug 2017 15:39
I have complex scenarios where items a hidden because no rights on it and items disabled for many other reasons.
Hiding all unusable item and my customer will calling me:

"There is a bug, the new element I have just created is not visible..."
Greg
Posted on: 25 Apr 2017 16:51
I have the scenario where items in various dropdown lists are fed by other tables (i.e. a user table, etc.).

As an example, an admin might delete a user (marked with flag, not actually destroyed). Since the user still exists in the table, their name can still appear in historical data.

When adding a new entry selecting, only active users should be seen in the dropdown.

When modifying an existing entry, active users plus the currently selected user should display. If the currently selected user is deleted, it must be disabled so that a different user must be selected.

If deleted users are not in the data source, their names cannot be displayed, only their number. This is ugly.

So it would be useful for the dropdown control to allow you to specify whether to show disabled entries as disabled, or to hide disabled entries (the one exception, being if the disabled entry is the selected entry, then it should show as disabled while all others are hidden).
Sergiu
Posted on: 27 Mar 2017 14:37
It would be really nice to add this feature, in Angular2 version too
Imported User
Posted on: 08 Feb 2017 03:10
This would be great! 
What I want to do is to not allow the user to re-select the initially selected option, meaning they can only select a different option! 
The idea is for an update page where the previously selected option has been marked 'inactive' on the database. The option will be displayed as the selected item but the user is not able to re-select that option if they change the value.
katechnology
Posted on: 26 Oct 2016 23:56
I used the select event approach mentioned in a previous comment, along with an ItemTemplate which applied a disabled class to grey the disabled item.

If the user clicked the disabled item then the Select event was cancelled.

It does mean the user can still click the disabled item, but they can't add it to the multiselect control.

@(Html.Kendo().MultiSelectFor(m => m.UsersSelected)
    .BindTo(Model.Users)
    .DataTextField("Name")
    .DataValueField("UserID")
    .Placeholder("Select users")
    .ItemTemplate("<span class=\"#: data.CssClass #\">#: data.Name #</span>")
    .Events(e =>
    {
        e.Select("onSelect");
    }))


<script>
        function onSelect(e) {

            if (e.dataItem.CssClass == "ms-disabled") {
                e.preventDefault();
            }
        };
    </script>
Pavel
Posted on: 06 Feb 2016 19:52
Would be great to have this feature plus an option whether to show disabled items (as inactive) or hide them completely.

Please consider the following scenario: There is viewModel (let's say a "Project") with an array property (let's say "Tasks"). Each task is rendered using a template with a DropDownList which in turn is populated from "Managers" field. Each manager can only be assigned one task, so after selection a manager the item should be disabled/hidden in all other dropdowns.

In other words this would be useful for scenarios with a shared dataSource and exclusive selection required.
Brian Mains
Posted on: 11 Dec 2015 20:40
In one of our systems, users like a:

------------------------------------------

separator between important items, but the user is not supposed to click on it.  So it would be nice if I could add these, but disable the ability to click them.  It would be nice to be able to enable/disable through a setting (and can style accordingly) and not having to use javascript.
balazs
Posted on: 03 Sep 2015 18:16
I cannot understand how a possibility to bind to a property (f.e. disabled) is not implemented. In jQuery it's quiet easy to do this (since you modify only DOM).
ADMIN
Telerik Admin
Posted on: 09 Apr 2014 14:49
Here's another solution that disables the first item in the multiselect dropdown:
http://trykendoui.telerik.com/ecAl/27

The idea is to apply the relevant disabled class, wire the select event of the widget and cancel the default selection when the user clicks the first item in the dropdown. Can you adapt this logic for your scenario?
Rob
Posted on: 31 Mar 2014 07:20
Hi, no this doesn't solve my problem. We need to display the items, but some are disabled. Take a look at the "Public methods" example on this plugin: http://loudev.com/. It shows item number 2, but you can't select it.
ADMIN
Telerik Admin
Posted on: 28 Mar 2014 17:33
If you set a certain option as disabled for the select html element to which the multiselect is attached, it won't be displayed at all as an option in its dropdown.

See this sample for reference:
http://trykendoui.telerik.com/ecAl/7 

Does this help?
Rob
Posted on: 26 Mar 2014 14:28
The current multiselect items can't be disabled, you can only disable the whole control itself. It would be great if we could disable certain multiselect items for example, so a end-user can see that there are more options, but that he doesn't have sufficient permissions to choose them.
Alexander
Posted on: 18 Jul 2013 13:24
This may be the same suggestion:
http://feedback.kendoui.com/forums/127393-kendo-ui-feedback/suggestions/4203269-add-option-group-support-to-kendo-drop-down-list