影子博客

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

private void gridView1_CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e)
{
if (((DevExpress.XtraGrid.GridSummaryItem)e.Item).FieldName.
CompareTo("z") == 0)
{
double totalMarks = Convert.ToDouble(gridColumn1.SummaryItem.SummaryValue);
double marksObtained = Convert.ToDouble(gridColumn2.SummaryItem.SummaryValue);

            if (totalMarks != 0)
            {
                e.TotalValue = marksObtained / totalMarks;
            }
            else
            {
                e.TotalValue = 0;
            }
        }
    }
posted on 2016-07-18 16:24  影子博客  阅读(497)  评论(0编辑  收藏  举报