Пример #1
0
        protected void GridView_Pagos_CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e)
        {
            try
            {
                if (e.SummaryProcess == CustomSummaryProcess.Start)
                {
                    TotalCordobas = 0;
                    TotalDolares  = 0;
                }
                else

                if (e.SummaryProcess == CustomSummaryProcess.Calculate)
                {
                    if (((ASPxSummaryItem)e.Item).Tag == "Cordobas")
                    {
                        if (e.GetValue("Moneda").ToString() == "Córdobas")
                        {
                            TotalCordobas += Convert.ToDecimal(e.FieldValue);
                        }
                    }
                    if (((ASPxSummaryItem)e.Item).Tag == "Dolares")
                    {
                        if (e.GetValue("Moneda").ToString() == "Dólares")
                        {
                            TotalDolares += Convert.ToDecimal(e.FieldValue);
                        }
                    }
                }

                else if (e.SummaryProcess == CustomSummaryProcess.Finalize)
                {
                    if (((ASPxSummaryItem)e.Item).Tag == "Cordobas")
                    {
                        e.TotalValue = TotalCordobas;
                    }
                    if (((ASPxSummaryItem)e.Item).Tag == "Dolares")
                    {
                        e.TotalValue = TotalDolares;
                    }

                    e.TotalValueReady = true;
                }
            }
            catch (Exception Ex)
            {
                FG.Controlador_Error(Ex, Page.Response);
            }
        }
Пример #2
0
 private void grid_CustomSummary(object sender, DevExpress.Data.CustomSummaryEventArgs e)
 {
     if (e.SummaryProcess == CustomSummaryProcess.Start)
     {
         totalPrice = 0;
     }
     if (e.SummaryProcess == CustomSummaryProcess.Calculate)
     {
         double price    = (double)e.FieldValue;
         int    quantity = (int)e.GetValue("Quantity");
         totalPrice  += price * quantity;
         e.TotalValue = totalPrice;
     }
 }