I am trying to populate A subgrid in a webgrid that is a nested webgrids. I am getting conflict in paging of the subgrids. When i select page 2 of a subgrid all the other subgrids in the webgrid changes to page 2 that is incorrect. only that subgrids should be affected for which is clicked paged 2. can anyone guide me through this ?
What I have tried:
@grid.GetHtml(htmlAttributes: new { ID = "grdSSI" }, tableStyle: "webGrid", displayHeader: true,
headerStyle: "header",
alternatingRowStyle: "alt",
selectedRowStyle: "select",
columns:
grid.Columns(
grid.Column("SSIGroupName", @HomeResource.SSIGridGroupName, format: item => Html.Raw(""), style: "POAGridMarketName"),
grid.Column("SegAccountRequired", @HomeResource.SSIGridSegregateAccountRequired),
grid.Column("FXRequired", @HomeResource.SSIGridFXRequired),
grid.Column("StatusDesc", @HomeResource.GridStatus),
//grid.Column("", "", format: (item) => Html.ActionLink("Delete", "DeleteSSI", new { ssiID = item.SSIID, customerName = Model.CustomerName, accountNumber = Model.AccountNumber, asOfDate = Model.AsOfDate }, new { @class = "deleteImg DeleteSSI" })),
grid.Column("", "Delete", format: (item) =>
{
var colorStyle = "";
if (item.IsPending == true)
{
colorStyle = "yellow";
}
else
{
colorStyle = "white";
}
var disableStyle = "";
if (item.StatusCode == "IA" || item.StatusCode == "UA" || item.StatusCode == "RA" || item.StatusCode == "DR")
{
disableStyle = "showDelete";
}
else
{
disableStyle = "";
}
return Html.ActionLink("Delete", "DeleteSSI", new { ssiID = item.SSIID, groupName = Model.GroupName, customerName = Model.CustomerName, accountNumber = Model.AccountNumber, asOfDate = Model.AsOfDate }, new { @class = "deleteImg DeleteSSI " + colorStyle + " " + disableStyle, title = "Delete" });
}),
grid.Column("", "Recover", format: (item) =>
{
var disableStyle = "";
if (item.StatusCode == "DA" || item.StatusCode == "RR")
{
disableStyle = "showRecover";
}
else
{
disableStyle = "";
}
return Html.ActionLink("Recover", "RecoverSSI", new { ssiID = item.SSIID, groupName = Model.GroupName, customerName = Model.CustomerName, accountNumber = Model.AccountNumber, asOfDate = Model.AsOfDate }, new { @class = "recoverImg RecoverSSI " + disableStyle, title = "Recover" });
}),
grid.Column(format: (item) =>
{
WebGrid subGrid = new WebGrid(source: item.SSISecurityCashAccountMapping, canSort: false);
return subGrid.GetHtml(htmlAttributes: new { id = "grdSSIAccounts" + item.SSIID }, tableStyle: "webGrid", displayHeader: true,
headerStyle: "header",
columns: subGrid.Columns(
subGrid.Column("AccountNumber", @HomeResource.SSIGridAccountNumber),
subGrid.Column("DepositoryCode", @HomeResource.SSIGridDepository),
subGrid.Column("SubCustodianName", @HomeResource.SSIGridSubCustodian),
subGrid.Column("SecurityAccountNumber", @HomeResource.SSIGridSecurityAccount),
subGrid.Column("CashAccountNumber", @HomeResource.SSIGridCashAccount)));
})
))