This question is locked. New answers and comments are not allowed.
@(Html.Telerik()
.Grid(Model.billsForReview)
// .Grid(new List<CopaySolutions.Core.StatementExt>())
.Name("MyBillSearchGrid")
.Footer(true)
//.Selectable()
.Columns(columns =>
{
columns.Bound(p => p.Date).Width(70);
columns.Bound(p => p.ProviderFullName);
columns.Bound(p => p.Amount).Width(86).Format("{0:c}")
//.Aggregate(aggregates => aggregates.Sum())
//.ClientFooterTemplate("Total: <#= Sum #>")
//.ClientGroupFooterTemplate("Total: <#= Sum #>");
.Aggregate(agr => agr.Sum().ToString())
.ClientFooterTemplate("Total Sum: <#= $.telerik.formatString('{0:c}', Sum) #>")
.ClientGroupFooterTemplate("Sum: <#= $.telerik.formatString('{0:c}', Sum) #>");
columns.Bound(p => p.PaymentDueDate);
.EnableCustomBinding(true)
.DataBinding(dataBinding => dataBinding.Ajax().Select("_GetStatementList", "Bills", new { clientId = "All", dateRange = "Last 6 Months", markedAsPaid = false }))
.Scrollable(scrolling => scrolling.Enabled(true).Height("180px"))
.ClientEvents(events => events.OnRowSelected("onBillSelected"))
.Sortable()
)
CONTROLLER:
_____________________________________________________________________________________
[GridAction(EnableCustomBinding = true)]
public ActionResult _GetStatementList(GridCommand command, string clientId, string dateRange, bool markedAsPaid)
{
GetStatementList getStatementList1 = new GetStatementList()
{
AccountId = this.AccountId,
ClientId = clientId,
ProviderId = "All",
StatementStatusId = StatementStatus.Completed.ToString() + ","
+StatementStatus.PendingReview.ToString() +","
+ StatementStatus.Processing.ToString() + ","
+ StatementStatus.Faulted.ToString() + ","
+ StatementStatus.PendingPayment.ToString() + ","
+ StatementStatus.PendingFix.ToString() ,
MarkedAsPaid = markedAsPaid,
SortExpression = TelerikGridHelper.GetSortExpression(command.SortDescriptors, "Date DESC"),
CurrentPageIndex = 0,
Date = ">= " + GetRangeValues(dateRange).ToShortDateString(),
PageSize = 1000
};
try
{
IPagedResult<StatementExt> statementList = getStatementList1.ExecutePagedResult();
return View(new GridModel<StatementExt> { Data = statementList.ItemList, Total = statementList.RecordCount });
}
catch (Exception e)
{
throw;
}
}
Footer sum is not working Please provide Solution of THis Problem as soon as possible.....
.Grid(Model.billsForReview)
// .Grid(new List<CopaySolutions.Core.StatementExt>())
.Name("MyBillSearchGrid")
.Footer(true)
//.Selectable()
.Columns(columns =>
{
columns.Bound(p => p.Date).Width(70);
columns.Bound(p => p.ProviderFullName);
columns.Bound(p => p.Amount).Width(86).Format("{0:c}")
//.Aggregate(aggregates => aggregates.Sum())
//.ClientFooterTemplate("Total: <#= Sum #>")
//.ClientGroupFooterTemplate("Total: <#= Sum #>");
.Aggregate(agr => agr.Sum().ToString())
.ClientFooterTemplate("Total Sum: <#= $.telerik.formatString('{0:c}', Sum) #>")
.ClientGroupFooterTemplate("Sum: <#= $.telerik.formatString('{0:c}', Sum) #>");
columns.Bound(p => p.PaymentDueDate);
.EnableCustomBinding(true)
.DataBinding(dataBinding => dataBinding.Ajax().Select("_GetStatementList", "Bills", new { clientId = "All", dateRange = "Last 6 Months", markedAsPaid = false }))
.Scrollable(scrolling => scrolling.Enabled(true).Height("180px"))
.ClientEvents(events => events.OnRowSelected("onBillSelected"))
.Sortable()
)
CONTROLLER:
_____________________________________________________________________________________
[GridAction(EnableCustomBinding = true)]
public ActionResult _GetStatementList(GridCommand command, string clientId, string dateRange, bool markedAsPaid)
{
GetStatementList getStatementList1 = new GetStatementList()
{
AccountId = this.AccountId,
ClientId = clientId,
ProviderId = "All",
StatementStatusId = StatementStatus.Completed.ToString() + ","
+StatementStatus.PendingReview.ToString() +","
+ StatementStatus.Processing.ToString() + ","
+ StatementStatus.Faulted.ToString() + ","
+ StatementStatus.PendingPayment.ToString() + ","
+ StatementStatus.PendingFix.ToString() ,
MarkedAsPaid = markedAsPaid,
SortExpression = TelerikGridHelper.GetSortExpression(command.SortDescriptors, "Date DESC"),
CurrentPageIndex = 0,
Date = ">= " + GetRangeValues(dateRange).ToShortDateString(),
PageSize = 1000
};
try
{
IPagedResult<StatementExt> statementList = getStatementList1.ExecutePagedResult();
return View(new GridModel<StatementExt> { Data = statementList.ItemList, Total = statementList.RecordCount });
}
catch (Exception e)
{
throw;
}
}
Footer sum is not working Please provide Solution of THis Problem as soon as possible.....