protected void UiVistaEncabezadoPendiente_CustomSummaryCalculate(object sender, CustomSummaryEventArgs e) { if (e.SummaryProcess != CustomSummaryProcess.Finalize) { return; } ASPxGridView gv = (ASPxGridView)sender; decimal totalInicioDeInventario = 0; decimal totalEgresoInventario = 0; if (e.IsTotalSummary) { totalInicioDeInventario = Convert.ToDecimal(gv.GetTotalSummaryValue(gv.TotalSummary["IN_INVENTORY"]) ?? 0); totalEgresoInventario = Convert.ToDecimal(gv.GetTotalSummaryValue(gv.TotalSummary["OUT_INVENTORY"]) ?? 0); e.TotalValue = totalInicioDeInventario - totalEgresoInventario; } }
protected void UiVistaFacturasVencidas_CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e) { if (e.SummaryProcess != CustomSummaryProcess.Finalize) { return; } if (((ASPxSummaryItem)e.Item).FieldName == "DOC_DATE") { ASPxGridView gv = (ASPxGridView)sender; decimal totalInicioDeInventario = 0; decimal totalEgresoInventario = 0; if (e.IsTotalSummary) { totalInicioDeInventario = Convert.ToDecimal(gv.GetTotalSummaryValue(gv.TotalSummary["DOC_TOTAL"]) ?? 0); totalEgresoInventario = Convert.ToDecimal(gv.GetTotalSummaryValue(gv.TotalSummary["PAID_TO_DATE"]) ?? 0); e.TotalValue = totalInicioDeInventario - totalEgresoInventario; } } }
protected void ASPxLabel1_Load(object sender, EventArgs e) { ASPxGridView grid = ASPxGridView1; GridViewDataColumn col = grid.Columns["UnitsInStock"] as GridViewDataColumn; ASPxSummaryItem summary = grid.TotalSummary["UnitsInStock", DevExpress.Data.SummaryItemType.Sum]; string text = summary.GetTotalFooterDisplayText(col, grid.GetTotalSummaryValue(summary)); ASPxLabel label = (ASPxLabel)sender; label.Text = string.Format("{0}\r\n({1})", col.FieldName, text); }
protected virtual ASPxLabel CreateSummaryItemControl(ASPxSummaryItem item, ASPxGridView grid) { var value = grid.GetTotalSummaryValue(item); var text = item.GetTotalFooterDisplayText(grid.DataColumns[item.FieldName], value); var label = new ASPxLabel(); label.EnableClientSideAPI = true; label.ID = string.Format("SummaryItemControl_{0}_{1}", item.FieldName, item.ShowInColumn); label.Text = text; label.Init += (s, e) => { SummaryTexts[label.ClientID] = label.Text; }; return(label); }
protected void gvProducts_DataBound(object sender, EventArgs e) { ASPxGridView gridView = sender as ASPxGridView; Hashtable summaries = new Hashtable(); foreach (ASPxSummaryItem item in gridView.TotalSummary) { summaries[item.FieldName] = item.GetTotalFooterDisplayText(gridView.Columns[item.FieldName], gridView.GetTotalSummaryValue(item)); } gridView.JSProperties["cpSummaries"] = summaries; }