This is a migrated thread and some comments may be shown as answers.

Disable Option Label

2 Answers 1119 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Phani
Top achievements
Rank 1
Phani asked on 02 Nov 2016, 04:25 PM

Hi There,

I am newbie to Kendo. I am having issue with DropdownlistFor while binding to Viewbag selectlist. In the below code  ViewBag.AddressList has a disabled value and it is not binding as disabled item in dropdownlist.

Please see below Code

 ViewBag.AddressList = new SelectList(model, "CodeOrder", "CodeDisplay",

                                         selectedValue: model[0].CodeOrder.ToString(),

                                          disabledValues: model[0].CodeOrder.ToString());

@Html.Kendo().DropDownListFor(m => m.AddressType)

                        .BindTo((SelectList)ViewBag.AddressList)

                       .HtmlAttributes(new {  @id = "ddlAddressType" })

 

In the attached image , Address Type is considered as option label and has to be disabled as well as not allowing user to select it.

Best Regards,

Phani

2 Answers, 1 is accepted

Sort by
0
Anton
Telerik team
answered on 03 Nov 2016, 07:33 AM
Hello Phani,

Currently, Kendo UI DropDownList widget does not support disabling items. However you could try the workarounds mentioned in this forum thread.

I noticed that you have opened a support ticket for the same issue. I would suggest to continue any further conversation there.

Regards,
Anton
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
0
Phani
Top achievements
Rank 1
answered on 03 Nov 2016, 03:22 PM

Hello Anton,

Thanks I did fix it now with the workarounds mentioned in the thread.

Best Regards,

Phani K

 

Tags
DropDownList
Asked by
Phani
Top achievements
Rank 1
Answers by
Anton
Telerik team
Phani
Top achievements
Rank 1
Share this question
or