I am trying to follow the example code of a cascading combobox here for some cascading drop down lists I need. I have 3 total drop down lists, just as in the example. The first cascading drop down is working fine. The only problem with the first cascading drop down is that my "optionlabel" is ignored completely. The second does not work at all. What's wrong with my second cascading drop down list, and how do I pass my vehicle type and my make to the action to get my models? Here are my drop down lists.
<script type="text/javascript">
function VehicleType() {
return {
VehicleType: $("#VehicleType").val()
};
}
function Make() {
return {
Make: $("#Make").val()
};
}
</script>
<%: Html.Kendo().DropDownListFor(i => i.VehicleType) .Name("VehicleType") .BindTo(new SelectList(Model.DemographicValues, "ValidValue", "ValidValueLabel")) .OptionLabel("Please Select") .HtmlAttributes(new {Style="Width:200px;"})%>
<%: Html.Kendo().DropDownListFor(i => i.Make) .Name("Make") .DataTextField("Make") .DataValueField("Make_Code") .DataSource(source => { source.Read(read => { read.Action("GetCascadeMakes", "Home") .Data("VehicleType"); }) .ServerFiltering(true); }) .OptionLabel("Please Select") .CascadeFrom("VehicleType") .Enable(false) .AutoBind(false) %>
<%: Html.Kendo().DropDownListFor(i => i.Model)
.Name("Model")
.DataTextField("Model")
.DataValueField("ModelCode")
.DataSource(source => {
source.Read(read =>
{
read.Action("GetCascadeModels", "Home")
.Data("Make");
})
.ServerFiltering(true);
})
.CascadeFrom("Make")
.Enable(false)
.AutoBind(false)
%>