This is a migrated thread and some comments may be shown as answers.

[Solved] Get checkbox value in controller

1 Answer 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vincent
Top achievements
Rank 1
Vincent asked on 27 Jun 2012, 06:35 PM
Hi,
I have this following code for my MVC grid.

Html.Telerik().Grid(Model.getListOperation())
   .Name("OperationGrid")
   .Columns(columns =>
                {
                    columns.Template(
                    @<text>
                    <input name="checkedOperations" type="checkbox" value="@item.OpCode" title="checkedOperations"
                    </text>).Width("50px");
                    columns.Bound(m => m.OpDesc).Title("Operations");
                }).Sortable(sorting => sorting.OrderBy(sortOrder => sortOrder.Add((m => m.OpDesc)).Ascending()))
   .Scrollable(c => c.Height("500px"))
   .Filterable()
   .Footer(false)
   .Render(); }


I would like to get wich checkbox are selected in my controller when I click on:  <input type="submit" value="Search" />

1 Answer, 1 is accepted

Sort by
0
Vincent
Top achievements
Rank 1
answered on 27 Jun 2012, 06:42 PM
Ok I just found the solution!

I add an attribute  public string[] checkedOperations { get; set; } in my model and everything worked well!
Tags
Grid
Asked by
Vincent
Top achievements
Rank 1
Answers by
Vincent
Top achievements
Rank 1
Share this question
or