Exemple #1
0
 /// <summary>
 /// columnUnitPrice.Footer.FinalizeCalculation event handler
 /// Finalizing the calculation and returning the calculated amount
 /// </summary>
 private void columnUnitPrice_Footer_FinalizeCalculation(object sender, DataGridFooterCalculationEventArgs e)
 {
     if (e.FooterItemIndex == 1)
     {
         e.Value = custCalculator.FinalizeCalcData();
     }
 }
Exemple #2
0
 /// <summary>
 /// columnUnitPrice.Footer.InitCalculation event handler
 /// Prepare UnitPrice for calculation
 /// SumCalculator custCalculator is used to calculate Sums
 /// </summary>
 private void columnUnitPrice_Footer_InitCalculation(object sender, DataGridFooterCalculationEventArgs e)
 {
     if (e.FooterItemIndex == 1)
     {
         custCalculator.InitCalcData(e.Column.DataType);
     }
 }
Exemple #3
0
        /// <summary>
        /// columnUnitPrice.Footer.RowStepCalculation event handler
        /// Calculate custCalculator step for one Row
        /// </summary>
        private void columnUnitPrice_Footer_RowStepCalculation(object sender, DataGridFooterCalculationEventArgs e)
        {
            if (e.FooterItemIndex == 1)
            {
                object upVal = columnUnitPrice.GetRowValue(e.Row);
                object qnVal = columnQuantity.GetRowValue(e.Row);
                if (!EhLibUtils.DBValueEqual(upVal, null) && !EhLibUtils.DBValueEqual(qnVal, null))
                {
                    Decimal upv = Convert.ToDecimal(upVal);
                    Decimal qnv = Convert.ToDecimal(qnVal);

                    Decimal decVal = upv * qnv;
                    custCalculator.StepCalcData(decVal);
                }
            }
        }