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

[Solved] disable a cascading dropdownlist

0 Answers 174 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tyler
Top achievements
Rank 1
Tyler asked on 04 Sep 2012, 08:37 PM
 have a cascading dropdown list of coutry-province in an applicant's address.
My trouble here is that at the initial binding of the applicant's country and province I want both dropdowns disabled.

Now I disabled the coutry dropdown without problem, but the province dropdown is enabled after the ajax call to the server.

@(Html.Telerik().DropDownListFor(model => model.Applicant.Country)
.BindTo(Model.Countrys)
.Enable(false)
.CascadeTo("Applicant_Province")
) *
@Html.ValidationMessageFor(m => m.Applicant.Country)


@(Html.Telerik().DropDownListFor(model => model.Applicant.Province)
.ClientEvents(events => events.OnDataBinding("onProvinceDropDownListDataBinding"))
.ClientEvents(events => events.OnDataBound("onProvinceDropDownListDataBound"))
.Enable(false)
.DataBinding(binding => binding.Ajax().Select("AjaxLoadProvinces", "Order"))) *
@Html.ValidationMessageFor(m => m.Applicant.Province)

In the function: onProvinceDropDownListDataBound
I tried to disable the dropdown, which does not work either.
$('#Applicant_Province').data("tDropDownList").disable();


Thanks.
Tags
ComboBox
Asked by
Tyler
Top achievements
Rank 1
Share this question
or