简体   繁体   English

Telerik Grid添加,更新和删除不起作用

[英]Telerik Grid add, update and delete not working

I'm using mvc c# and Html.Telerik().Grid 我正在使用mvc c#和Html.Telerik()。Grid

I want to add, update and delete on grid. 我想在网格上添加,更新和删除。 but it doesn't post the data to add, update and delete function. 但它不会发布数据以添加,更新和删除功能。

this is my grid 这是我的网格

@(Html.Telerik().Grid<GownHire.Models.tblstudent>()
        .Name("Grid")
        .DataKeys(dataKeys => dataKeys.Add(c => c.PKStudentID))
        .ToolBar(commands => commands.Insert())
        .DataBinding(dataBinding => dataBinding

            .Ajax()                
                .Select("_studentList", "Admin")              
                .Insert("studentInsert", "Admin")                
                .Update("studentUpdate", "Admin")                
                .Delete("studentDelete", "Admin")
        )
        .Columns(columns =>
        {
            columns.Bound(c => c.studentEnterDate);
            columns.Bound(c => c.flage);

            columns.Command(commands =>
            {
                commands.Edit();
                commands.Delete();
            })
                       .Width(180);
        }))

this is mu functions 这是亩功能

    [GridAction(EnableCustomBinding = true)]
    public ActionResult studentUpdate(GridCommand command, tblstudent model)
  {
    // model data is null
    }

what is the wrong with my code? 我的代码有什么问题?

user1348351: your actionMethod "CeremonyUpdate" is not what you declared on the grid. user1348351:您的actionMethod“ CeremonyUpdate”不是您在网格上声明的内容。 Change it to "_studentList" for selecting data and it will work 将其更改为“ _studentList”以选择数据,它将起作用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM