Duplicated
Last Updated: 18 Jan 2023 06:55 by ADMIN
Cassandra
Created on: 11 Jan 2023 13:15
Category: ComboBox
Type: Feature Request
1
Is there a property I can set on a TelerikComboBox to say an element in the list is no longer available for selection.

I would like the ability to flag elements in a data bound combo that are no longer available as disabled and not selectable.  Had they been previously selected, they still need to show, but should not allow a user to select it again.

I would like a property that can be set when databinding a combo.

For instance when you set the Data, TextField, & ValueField properties, can there also be one for SelectableField (or something) - this could be mapped to a Boolean in the dataset.

If this property isn't used then it defaults to yes (ie they are all selectable), but if it is used, then any items which have this field set to 'no' then they show as a different color (could just be grey) but are not selectable by the user.

If they had previously been selected (prior to being marked as no longer available) then they should show when the record is loaded, but otherwise they are not selectable.

I don't particularly want to write code on click to see if its enabled and then unselect it, I would prefer it to simply be built into the base control.

Is this possible?  Or is there another property already there that does this?

Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
1 comment
ADMIN
Dimo
Posted on: 18 Jan 2023 06:55

Hello Cassandra,

Use the OnItemRender event to detect and style the disabled items.

Then, use the ValueChanged event to get the complete data item, check the "Selectable" property, and prevent the selection of those items conditionally.

I understand that you may prefer a more "built-in" approach, but this is what we came up with, after we evaluated all options for implementation and what most customers needed (custom styling).

Regards,
Dimo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.