简体   繁体   中英

Telerik Grid add, update and delete not working

I'm using mvc c# and 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. Change it to "_studentList" for selecting data and it will work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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