2012-05-16 173 views
3

我有一個網格,其中前2列與ForeignKey(類別和產品)綁定。第一個下拉列表的值決定了第二個下拉列表的值。如何在第一個下拉值更改後重新加載第二個下拉列表的值?Telerik mvc網格ForeignKey列

@(Html.Telerik().Grid<Order>().HtmlAttributes(new { style = "width: 700px" }) 
.Name("grdOrders") 
.ToolBar(tb => tb.Insert()) 
.DataBinding(binding => binding.Ajax() 
    .Select("GetOrders", "Home") 
    .Update("UpdateOrder", "Home") 
    .Insert("InsertOrder", "Home") 
    .Delete("DeleteOrder", "Home")) 
.DataKeys(keys => keys.Add(o => o.OrderID)) 
.Columns(cols => 
{ 
    cols.Bound(c => c.OrderID).Width(100).ReadOnly(); 
    cols.Bound(c => c.Name); 
    cols.ForeignKey(c => c.ItemCategoryID, (System.Collections.IEnumerable)ViewData["Categories"], 
        "ItemCategoryID", "CategoryName").Title("dbCategory").Width(300);   
    cols.ForeignKey(c => c.ItemID, (System.Collections.IEnumerable)ViewData["dbItems"], 
       "ItemID", "ItemName").Width(200).Title("Item"); 
    cols.Command(cmd => 
    { 
     cmd.Edit().ButtonType(GridButtonType.Image); 
     cmd.Delete().ButtonType(GridButtonType.Image); 
    }).Title("Commands").Width(100); 
}) 
+0

有人嗎?我非常需要這個解決方案 – samantha07

回答