Add HTML input type in the column of webgrid which is something like this…
grid.Column(header: "CheckBox", format: @<text><input name="checkbox" type="checkbox" value="@item.ID" /></text>)
grid.Column(header: "CheckBox", format: @<text><input name="checkbox" type="checkbox" value="@item.ID" /></text>)
So your whole webgrid coding will look something like this….
@{ var grid = new WebGrid(source: Model, rowsPerPage: 40); } @grid.GetHtml( tableStyle: "grid", headerStyle: "head", alternatingRowStyle: "alt", columns: grid.Columns( grid.Column("Column1"), grid.Column("Column2"), grid.Column(header: "CheckBox", format: @<text><input name="checkbox" type="checkbox" value="@item.ID" /></text>) ) )
No comments:
Post a Comment