deexith k

deexith k

  • NA
  • 10
  • 1.1k

grid within the grid.i want first grid and subgrid values.

Jul 29 2015 10:07 AM
@using (Html.BeginForm("View1", "Login", FormMethod.Post))
{
<div id="main" style="padding:25px; background-color:lightblue;">
@grid.GetHtml(
htmlAttributes: new { id = "gridT", width = "1200px" },
columns: grid.Columns(
grid.Column("systables.tabname", "Table Name"),
grid.Column("systables.object_id", " Object Id"),
 grid.Column(format: @<text><input type="checkbox" name="ids" value="@item.systables.object_id" /></text>, header: "Select"), 
grid.Column(format: (item) =>
{
WebGrid subGrid = new WebGrid(source: item.syscolumns);
return subGrid.GetHtml(
htmlAttributes: new { id = "subT" },
columns: subGrid.Columns(
subGrid.Column("tabname", "Table Name"),
subGrid.Column("object_id", " Object Id"),
subGrid.Column("column_id", "Column Id"),
subGrid.Column("colname", "Column Name"),
subGrid.Column("coltype", "column Type")
//,subGrid.Column("colselect", "col select") 
@*subGrid.Column(format: @<text><input type="checkbox" value="@syscolumns.object_id" /></text>, header: "Select")*@
)
);
})
)
)
<input type="submit" value="Click" class="btn btn-default btn-primary" />
</div>
}