Adding check boxes to each row on MVCcontrib Grid

后端 未结 4 1384
说谎
说谎 2021-02-06 00:29

How can I add a checkbox to each row of a MVCcontrib grid. then when the form is posted find out which records were selected? I Am not finding much when searching for this. Tha

4条回答
  •  滥情空心
    2021-02-06 01:12

    Dont know if this helps but I did a similar thing using the code below:

    @Html.Grid(Model.PagedModel).AutoGenerateColumns().Columns(column => {
    column.For(a => Html.ActionLink("Edit", "Edit", new { a.ID })).InsertAt(0).Encode(false);
    column.Custom(a => Html.Raw("" ) );
    })
    

    My controller was then able to receive the selected checkboxlist items:

    [HttpPost]
    public ViewResult List(string[] resubmit)
    

提交回复
热议问题