I have a grid that is an IList:
@Html.Grid(Model.ExampleList).Columns(c =>
{
c.For(a => string.Format("{0:dd/MM/yyyy}", a.DateRequested)).Named("Date Requested");
c.For(a => a.Comment).Named("Comment");
})
But I would like to add a flag that will send back to the controller. Something like this:
@using (Html.BeginForm("PostExample", "Home"))
{
<input type="hidden" name="SomeId" value=@ViewBag.SomeId/>
<input type="hidden" name="AnotherId" value="AnotherId" />
@Html.CheckBox("Complete", Model.Complete, new { onClick = "$(this).parent('form:first').submit();"
});
But I'm not sure how to combine them. What is the best way to do this? Any help would be greatly appreciated.
source
share