Please help me to select the Selected Row ID from radiobutton field in MVC 4 WebGrid? I am not submitting the form, but pointing to HTTpGet action Method of the same view using a button.
Here is the View:
var grid = new WebGrid(ViewBag.inCompletePipelines, canPage: true, rowsPerPage: 10,
selectionFieldName: "selectedRow", ajaxUpdateContainerId: "inCompletePipelines");
grid.Pager(WebGridPagerModes.NextPrevious);
<div id="gridinCompletePipelines" class="gridwidthLong">
@grid.GetHtml(tableStyle: "webGrid",
headerStyle: "header",
alternatingRowStyle: "alt",
selectedRowStyle: "select",
columns: grid.Columns(
grid.Column("Name", " Pipeline Name"),
grid.Column("Length", " Length"),
grid.Column("ModifiedDate", "Modified Date"),
grid.Column("ModifiedBy", "Modified By"),
grid.Column(
header: "Select",
format: @<text>@Html.RadioButtonFor(x => x.Id, (int)item.Id)</text>
)
))
@Html.ActionLink("New Pipeline", "pipelines_saved", "PipeLine", new { Id= grid.SelectedRowID ???????? }, new {@class = "roundedButton" })