1
我想在嵌套列上調用父項源的PkId作爲nestgrd.Column(「Qty」,格式:(item)=> Html.ActionLink((string)item。 Product.ToString(),「FreeGiftQuantityViews」,new {id = item.PkId}但我無法調用。我如何將新的{id = item.PkId}作爲新的{id = pkglist.item.PkId}調用如何通過嵌套GridView的內容調用父Gridview的項目Id
<div id="lgrid" class="tablesorter">
@{
var grid = new WebGrid(Model.pkglist, rowsPerPage: 10, canSort: false, canPage: false, ajaxUpdateContainerId: "lgrid");
}
@grid.GetHtml(
tableStyle: "lgrid",
headerStyle: "head",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column("S.N.", format: @<text>@{count++;}@count</text>, style: "sn"),
grid.Column("PkId", format: @<text>@item.PkId</text>),
grid.Column("Package Name", format: @<text>@item.PackageName</text>),
grid.Column("Product", format: @<text>@item.Product</text>),
grid.Column("Access", format: @<text>@item.Access</text>),
grid.Column("Rate", format: @<text>@item.Rate</text>),
grid.Column("Remarks", format: @<text>@item.Remarks</text>),
grid.Column("Edit", format: (item) => Html.ActionLink("Edit", "EditPackage", new { id = item.PkId }, new { @class = "openDialog", data_dialog_id = "emailDialog", data_dialog_title = "Edit" })),
grid.Column("Delete", format: (item) => Html.ActionLink("Delete", "DeletePackage", new { id = item.PkId }, new { @class = "openDialog", data_dialog_id = "emailDialog", data_dialog_title = "Delete" })),
grid.Column("Free Package Lists", format: row =>
{
WebGrid nestgrd = new WebGrid(row.plsst);
return nestgrd.GetHtml(
columns: nestgrd.Columns(
nestgrd.Column("FreePackageDetails", format: (item) => Html.ActionLink((string)item.Product.ToString(), "FreePackageDetails", new { id = item.PkId }, new { @class = "openDialog", data_dialog_id = "EmailDialog", data_dialog_title = "Details" })),
nestgrd.Column("Free Gift", format: (item) => Html.ActionLink((string)item.Product.ToString(), "FreeGiftViews", new { id = item.PkId }, new { @class = "openDialog", data_dialog_id = "EmailDialog", data_dialog_title = "Details" })),
nestgrd.Column("Qty", format: (item) => Html.ActionLink((string)item.Product.ToString(), "FreeGiftQuantityViews", new { id = item.PkId }, new { @class = "openDialog", data_dialog_id = "EmailDialog", data_dialog_title = "Details" }))
),
displayHeader: false
);
})
))
</div>