1

I have KendoUI grid implementation as shown below, it pulls and displays the data into the grid, but on create or update it is not working because it always makes Get request to the server,

the controller method marked as post for create and update - [AcceptVerbs(HttpVerbs.Post)] is there any where we can specify the Http method from client code?

also there is a same issue with sorting as well, the sample demo app that Kendo UI shows all makes Post method, but this one makes get, so it does not pass the sorting related objects to controller method properly

@(Html.Kendo().Grid<Model.Storage>()    
.Name("Grid")    
.Columns(columns => {        
    columns.Bound(p => p.Id);
    columns.Bound(p => p.Name);
    columns.Bound(p => p.Path);
    columns.Bound(p => p.Default);
    columns.Command(command => { command.Edit(); });
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Scrollable()
.DataSource(dataSource => dataSource        
    .Ajax()                 
    .Events(events => events.Error("error_handler"))
    .Model(model => model.Id(p => p.Id))
    .Create(update => update.Action("EditingInline_Create", "Storage"))
        .Read(read => read.Action("EditingInline_Read", "Storage"))
        .Update(update => update.Action("EditingInline_Update", "Storage"))
)
)

Help on this would be really appreciated.. !

tereško
  • 58,060
  • 25
  • 98
  • 150
Srini
  • 708
  • 1
  • 8
  • 23

3 Answers3

2

Check the troubleshooting help topic: http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/troubleshooting

You have not included kendo.aspnetmvc.min.js.

Atanas Korchev
  • 30,562
  • 8
  • 59
  • 93
2

Yes, you can specify the HttpMethod from the client code. Change your DataSource methods to look like this:

.Create(update => update.Action("EditingInline_Create", "Storage").Type(HttpVerbs.Post))
.Read(read => read.Action("EditingInline_Read", "Storage").Type(HttpVerbs.Post))
.Update(update => update.Action("EditingInline_Update", "Storage").Type(HttpVerbs.Post))

HTH!

Robert McLaws
  • 2,258
  • 2
  • 19
  • 22
1

Make sure you're not using jQuery 1.8, I had a similar problem with their controls and it turned out to be a compatibility problem with 1.8.

Nick Albrecht
  • 16,607
  • 10
  • 66
  • 101