【问题标题】:Can't see edit buttons in telerik grid在 Telerik 网格中看不到编辑按钮
【发布时间】:2011-12-24 08:06:08
【问题描述】:

我正在创建一个 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();
}

据我了解,这应该会显示一个编辑按钮,但我在表格中看不到一个..

【问题讨论】:

    标签: c# asp.net telerik telerik-grid


    【解决方案1】:

    仅设置Editable 选项是不够的,您需要将编辑命令添加到您的列中:

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

    查看Telerik Demo 网站了解更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多