Tag: cascadingdropdown

MVC 3 Cascading DropDownLists

我不知道如何准确地拥有Cascading DropDownLists 我的情景是下一个: 类别有物品和物品的数量取决于企业 我希望有两个DropDownLists,您选择一个Category,当您选择第一个包含该Category中的Items时,将填充下一个DropDownLists,当您选择Item时,将显示包含每个建立的数量的表。 好的,这将是我的ActionResult public ActionResult ItemByClinic(Guid? Item_ID, Guid? Category_ID) { ViewData[“Categories”] = InventoryDb.Categories; if (Category_ID != null) { ViewBag.Category_ID = Category_ID; ViewData[“Items”] = InventoryDb.Items.Where(i => i.Category.ID == Category_ID); if (Item_ID != null) { ViewBag.Item_ID = Item_ID; ViewData[“Inventory”] = InventoryDb.Items.Single(i => i.ID == Item_ID).Inventory; } } return View(); } 然后,我会让我的两个DropDownLists应该将值发布到Item_ID和Category_ID …第一个类别然后是项目 @Html.DropDownList(“Categories”, new […]

KendoUI级联下拉列表,需要2个下拉列表的值。

我有3个级联下拉列表如下: Catergories: @(Html.Kendo().DropDownList() .Name(“categories”) .OptionLabel(“Select category…”) .DataTextField(“CategoryName”) .DataValueField(“CategoryId”) .DataSource(source => { source.Read(read => { read.Action(“GetCascadeCategories”, “ComboBox”); }); }) ) Products: @(Html.Kendo().DropDownList() .Name(“products”) .OptionLabel(“Select product…”) .DataTextField(“ProductName”) .DataValueField(“ProductID”) .DataSource(source => { source.Read(read => { read.Action(“GetCascadeProducts”, “ComboBox”) .Data(“filterProducts”); }) .ServerFiltering(true); }) .Enable(false) .AutoBind(false) .CascadeFrom(“categories”) ) function filterProducts() { return { categories: $(“#categories”).val() }; } Orders: @(Html.Kendo().DropDownList() .Name(“orders”) .OptionLabel(“Select […]

EditItemTemplate中AJAX CascadingDropDown和DropDownList SelectedValue的问题

我在FormView的EditItemTemplate中遇到问题。 当我在InsertItemTemplate中使用这样的代码时,一切正常: <asp:DropDownList ID="Lic_PosiadaczLicencjiIDDropDownList" runat="server" SelectedValue='’ /> 但是当我在EditItemTemplate中使用完全相同的代码时,我收到一个错误,即SelectedValue是错误的,因为它不存在于元素列表中。 我认为问题是DropDownList在服务填充之前检查了值。 当我运行调试器时,错误发生在服务方法中的断点之前。 如何解决这个问题呢?