This is a migrated thread and some comments may be shown as answers.

Override Grid edit button

1 Answer 258 Views
Grid
This is a migrated thread and some comments may be shown as answers.
AspenSquare
Top achievements
Rank 1
AspenSquare asked on 14 Nov 2012, 04:50 PM
The edit button goes back to my controller as a 'Get' but I would like to change it to a 'Post'. Is this possible?


@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Id).Width(25);
        columns.Bound(p => p.Name).Width(240);
        columns.Bound(p => p.City).Width(170);
        columns.Bound(p => p.State).Width(170);
        columns.Command(command =>
        {
            command.Edit();
            command.Custom("Delete").Click("deleteIt");
         }).Width(166);
     })
          .Scrollable()
          .Editable(editable => editable.Mode(GridEditMode.InLine))
          .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model => model.Id(p => p.Id))
            //.Read("PropertyRead", "Property"))
            .Read(read => read.Action("PropertyRead", "Property"))
            .Update(update => update.Action("Update", "Property"))
            .Destroy(destroy => destroy.Action("Delete", "Property"))
            )
     )

1 Answer, 1 is accepted

Sort by
0
AspenSquare
Top achievements
Rank 1
answered on 14 Nov 2012, 06:11 PM
As per this post: http://www.kendoui.com/forums/mvc/grid/post-vs-get-request.aspx


@(Html.Kendo().Grid(Model)
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Id).Width(25);
        columns.Bound(p => p.Name).Width(240);
        columns.Bound(p => p.City).Width(170);
        columns.Bound(p => p.State).Width(170);
        columns.Command(command =>
        {
            command.Edit();
            command.Custom("Delete").Click("deleteIt");
         }).Width(166);
     })
          .Scrollable()
          .Editable(editable => editable.Mode(GridEditMode.InLine))
          .DataSource(dataSource => dataSource
            .Ajax()
            .Model(model => model.Id(p => p.Id))
            //.Read("PropertyRead", "Property"))
            .Read(read => read.Action("PropertyRead", "Property"))
            .Update(update => update.Action("Update", "Property").Type(HttpVerbs.Put))
            .Destroy(destroy => destroy.Action("Delete", "Property"))
            )
     )
Tags
Grid
Asked by
AspenSquare
Top achievements
Rank 1
Answers by
AspenSquare
Top achievements
Rank 1
Share this question
or