• Aspxgridview 根据条件来自定义计算Totalsummery


     1         protected void ASPxGridView1_CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e)
     2         {
     3             int totalSum = 0;
     4             // Initialization.
     5             //if (e.SummaryProcess == DevExpress.Data.CustomSummaryProcess.Start)
     6             totalSum = 0;
     7             // Calculation.                      
     8             //if (e.SummaryProcess == DevExpress.Data.CustomSummaryProcess.Calculate)
     9             if(((ASPxPageControl)grid.FindDetailRowTemplateControl(Eindex, "ASPxPageControl1"))==null)return;
    10             for (int i = 0; i < ((ASPxGridView)((ASPxPageControl)grid.FindDetailRowTemplateControl(Eindex, "ASPxPageControl1")).FindControl("ASP          xGridView1")).VisibleRowCount; i++)
    11             {
    12                 if (Convert.ToString(((ASPxGridView)((ASPxPageControl)grid.FindDetailRowTemplateControl(Eindex, "ASPxPageControl1")).FindControl                ("ASPxGridView1")).GetRowValues(i, new string[] { "XXX" })) == "False")
    13                     totalSum += Convert.ToInt32(((ASPxGridView)((ASPxPageControl)grid.FindDetailRowTemplateControl(Eindex, "ASPxPageControl1")).              FindControl("ASPxGridView1")).GetRowValues(i, new string[] { "YYYY" }));
    14             }
    15             // Finalization.
    16             //if (e.SummaryProcess == DevExpress.Data.CustomSummaryProcess.Finalize)
    17             e.TotalValue = totalSum;
    18         }
    19 
    20         protected void grid_DetailRowExpandedChanged(object sender, ASPxGridViewDetailRowEventArgs e)
    21         {
    22             //if (e.Expanded)    //判断是否是点击展开
    23             //{
    24             //    flag = true;
    25                 Eindex = e.VisibleIndex;
    26             //}
    27         }
    年轻过得闲,以后被人嫌... 年轻累不死....
  • 相关阅读:
    codevs 2021 中庸之道
    bzoj 1227: [SDOI2009]虔诚的墓主人
    cogs 2620. [HEOI2012]朋友圈
    bzoj 3123: [Sdoi2013]森林(45分暴力)
    cogs 1685 魔法森林
    bzoj 1061: [Noi2008]志愿者招募
    poj 1743 Musical Theme
    bzoj 1001: [BeiJing2006]狼抓兔子
    bzoj 4006: [JLOI2015]管道连接
    hdu 5693 D Game
  • 原文地址:https://www.cnblogs.com/hrx-star/p/3584909.html
Copyright © 2020-2023  润新知