I successfully added a WebGrid with a DropDownList that displays the correct data. I have each row set up for a user can set an error level for an error alert. So my question is how do I submit (HttPost) the WebGrid back to the Controller? I created a property in my model but this being the first time I working with a WebGrid I am not sure how to accomplish this.
Here is a snippet from my View:
var grid = new WebGrid(Model.UserAlerts,
defaultSort: "ErrorCategory",
rowsPerPage: 20);
...
@using (Html.BeginForm())
{
<div id="grid">
@grid.GetHtml(
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column("ErrorCategory", "Error Category"),
grid.Column("Error", "Error Name"),
grid.Column(header: "Error Level", format: @<text> @Html.DropDownList("ErrorLevelList")</text>)
)
)
</div>
...
}