meds
meds

Reputation: 22916

Can't see edit buttons in telerik grid

I'm creating a telerik grid as follows:

@{
    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();
}

From what I understand this should display an edit button but I don't see one in the table..

Upvotes: 0

Views: 312

Answers (1)

nemesv
nemesv

Reputation: 139748

It's not enough to set the Editable option, you need to add the Edit command to your columns:

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

See the Telerik Demo site for more info.

Upvotes: 2

Related Questions