Can I give a AutoComplete object to a dropdownlist's CascadeFrom parameter? I have tried it but it didn't work.(two dropdownlist worked fine)
public JsonResult GetCustomers() { return Json(CustomerRepository.Repository.Customers, JsonRequestBehavior.AllowGet); } public JsonResult GetVendors(int customerId,int customerId2) { return Json(VendorRepository.Repository.GetVendorsByCustomer(customerId), JsonRequestBehavior.AllowGet); }function filterVendors() { return { customerId: $("#CustomerId").data("kendoAutoComplete").value(), customerId2: $("#CustomerId").data("kendoAutoComplete").value(), };}function filterProducts() { return { vendorId: $("#VendorId").data("kendoDropDownList").value() };}
<dl> <dt> @Html.LabelFor(m => m.CustomerId): </dt> <dd> @(Html.Kendo().AutoCompleteFor(m => m.CustomerId).Name("CustomerId") .ValuePrimitive(true) .DataTextField("CustomerId") .DataSource(dataSource => { dataSource.Read(read => read.Action("GetCustomers", "Home")) .ServerFiltering(true); }) ) @Html.ValidationMessageFor(m => m.CustomerId) </dd></dl><dl> <dt> @Html.LabelFor(m => m.VendorId): </dt> <dd> @(Html.Kendo().DropDownListFor(m => m.VendorId) .AutoBind(false) .ValuePrimitive(true) .OptionLabel("Select Vendor...") .DataTextField("VendorName") .DataValueField("VendorId") .DataSource(dataSource => { dataSource.Read(read => read.Action("GetVendors", "Home").Data("filterVendors")) .ServerFiltering(true); }) .CascadeFrom("CustomerId") ) @Html.ValidationMessageFor(m => m.VendorId) </dd></dl>