Hello, I have a grid I am using to display detail info on a view. The columns .ClientTemplate logic works fine in a View.
However, the client wants the detail view to be displayed as a Modal Window over the summary listing. I have this working as a PartialView however the logic in the .ClientTemplate does not work in the Modal windows.
This is the working Code in the view. The highlighted section is the ClientTemplate that DOES NOT work when rendered as a PartialView in the Modal window.
@(Html.Kendo().Grid(Model.claimDetails)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.Ln).ClientTemplate(
"# if (Ln == '0') { #" +
"Total Chrg" +
"# } else { #" +
"Line #= Ln #" +
"# } #"
);
columns.Bound(p => p.Chrg).Format("{0:C}").Title("Charge");
columns.Bound(p => p.IncurFrm).Format("{0:MM/dd/yyyy}").Title("Svc Date").Width(130);
columns.Bound(p => p.ProcRev).Title("Proc/Revenue Code").Width(130);
columns.Bound(p => p.OCAllowed).Format("{0:C}").Title("OC allow").Width(130);
columns.Bound(p => p.OCPaid).Format("{0:C}").Title("OC Paid").Width(130);
columns.Bound(p => p.BenAmt).Format("{0:C}").Title("Benefit Amt.").Width(130);
columns.Bound(p => p.OCDedAmt).Format("{0:C}").Title("OC Ded").Width(130);
columns.Bound(p => p.CoInsurDed).Format("{0:C}").Title("Ded Amt").Width(130);
columns.Bound(p => p.CoInsur1).Format("{0:C}").Title("Coins Amt 1").Width(130);
columns.Bound(p => p.Copay).Format("{0:C}").Title("CoPay Amt");
columns.Bound(p => p.RemarkCd).Title("Remark Cd");
columns.Bound(p => p.InElig).Format("{0:C}").Title("Tot Inelig Amt");
columns.Bound(p => p.PdClmnt).Format("{0:C}").Title("Pd to Ins");
columns.Bound(p => p.PdProv).Format("{0:C}").Title("Pd to Prov");
})
.HtmlAttributes(new { style = "height: 600px;" })
.Sortable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(false)
)
)
Hi George,
Thank you for the code snippet and details provided.
In order to achieve the desired behavior, I would recommend using the approach from the following demo:
All the data from the Model could be shown in the popup window.
Give a try to the approach above and let me know if further assistance is needed.
Kind Regards,
Anton Mironov