I am using Html.Grid in my asp.net MVC2 application.
The grid contains checkboxes per row.
<%= Html.Grid<MyViewModel>(Model.MyList)
.Columns( column => {
column.For(x => Html.CheckBox("Select", false, new { id = x.ID })).DoNotEncode();
I need to loop through the checked records and action them. How can I retrieve the checked id values when I do a postback on a button click.
Thanks :)
I have this working with more or less the same grid code.
The Checkbox column I have defined more or less the same as yours:
The grid is wrapped in a form.
The form posts back to the following method.
If you have "Select" as the checkbox name, then I guess the parameter name would also be Select.