我想将嵌套列上的父源 PkId 称为 nestgrd.Column("Qty", format: (item) => Html.ActionLink((string)item.Product.ToString(), "FreeGiftQuantityViews", new { id = item.PkId } 但我无法调用。我怎样才能调用 new { id = item.PkId } as new {id= pkglist.item.PkId}
<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>