2011-12-24 28 views
0

我創建一個Telerik的網格如下:無法看到編輯按鈕Telerik的網格

@{ 
    GridEditMode mode = GridEditMode.InLine; 
    GridButtonType type = GridButtonType.Text; 

    Html.Telerik().Grid<testing.testtable>("testtable") 
     .Name("Grid") 
     .Pageable() 
     .Sortable() 
     .Filterable() 
     .Groupable() 
     .DataKeys(keys => keys.Add(c => c.intcolumn)) 
     .DataBinding(dataBinding => dataBinding.Server() 
      .Insert("Insert", "HomeController", new { mode = mode, type = type }) 
      .Update("Save", "HomeController", new { mode = mode, type = type }) 
      .Insert("Delete", "HomeController", new { mode = mode, type = type })) 
     .Columns(columns => 
     { 
      columns.Bound(o => o.intcolumn); 
      columns.Bound(o => o.stringcolumn); 
     }) 
     .Editable(editing => editing.Mode(GridEditMode.InLine)) 
     .Render(); 
} 

據我所知這應該顯示的編輯按鈕,但我沒有看到一個在表中。 。

回答

2

這是不夠的設定Editable選項,你需要編輯命令添加到您的列:

.Columns(columns => 
     { 
      columns.Bound(o => o.intcolumn); 
      columns.Bound(o => o.stringcolumn); 
      columns.Command(commands => commands.Edit()); 
     }) 

Telerik Demo網站獲取更多信息。

相關問題