2010-12-02 90 views
0

我有一個使用telerik網格的視圖。使用asp.net使用Telerik Grid的部分視圖問題mvc

IHAVE其中我將數據傳遞到視圖

public ActionResult GridList(int id) 
     { 
      _genrepo.GetCategoriesForControlPlanTemplateByControlPlanID(CurrentHealthPlanId,id); 

      return PartialView(_viewModel); 
     } 

獵人一個控制器上的代碼:這裏是我的網

<%= Html.Telerik().Grid(Model) 
     .Name("Grid") 
     .Columns(columns => 
     { 
      columns.Bound(o => o.OrderID).Width(100); 
      columns.Bound(o => o.ContactName).Width(200); 
      columns.Bound(o => o.ShipAddress); 
      columns.Bound(o => o.OrderDate).Format("{0:MM/dd/yyyy}").Width(120); 
     }) 
     .DataBinding(dataBinding => 
     { 
      dataBinding.Server().Select("FirstLook", "Grid", new { ajax = 
       ViewData["ajax"] }); 
      dataBinding.Ajax().Select("_FirstLook", 
       "Grid").Enabled((bool)ViewData["ajax"]); 
     }) 
     .Scrollable(scrolling => scrolling.Enabled((bool)ViewData["scrolling"])) 
     .Sortable(sorting => sorting.Enabled((bool)ViewData["sorting"])) 
     .Pageable(paging => paging.Enabled((bool)ViewData["paging"])) 
     .Filterable(filtering => filtering.Enabled((bool)ViewData["filtering"])) 
     .Groupable(grouping => grouping.Enabled((bool)ViewData["grouping"])) 
     .Footer((bool)ViewData["showFooter"]) 
%> 

我能夠與完美顯示數據的GRDI pagging .. 但問題是當我打第二頁..整個網格顯示我在一個靜態頁面。我無法看到網格..我希望它的局部視圖問題..我無法在部分視圖頁面上實現分頁排序和過濾?

任何機構可以幫助我如何避免這種情況在部分視圖上工作?

在此先感謝

+0

你的網格初始值設定項是什麼樣的? – hunter 2010-12-02 18:06:24

回答

1

有一個example說明如何實現與Telerik的網格組件,用於ASP.NET MVC分頁。

+2

感謝達林,我看到任何關於局部視圖問題的例子?甚至在部分視圖中我的網格排序和paggig不工作,這是我的問題.. – kumar 2010-12-02 18:11:49