本文主要是介绍DevExpress GridControl SummaryItem的Custom Summary,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
转自:http://blog.vsharing.com/janezhangxy/A1453525.html
int customSum;private void gridView1_CustomSummaryCalculate(object sender, DevExpress.Data.CustomSummaryEventArgs e){int summaryID = Convert.ToInt32((e.Item as GridSummaryItem).Tag);GridView gridView = sender as GridView; // Initialization if (e.SummaryProcess == CustomSummaryProcess.Start){customSum = 0;}// Calculation if (e.SummaryProcess == CustomSummaryProcess.Calculate){bool isSelected = (bool)gridView.GetRowCellValue(e.RowHandle, "Selected");switch (summaryID){case 1: // The total summary calculated against the 'CurrentApplyQuantity' column. if (isSelected) customSum += Convert.ToInt32(e.FieldValue); break; }}// Finalization if (e.SummaryProcess == CustomSummaryProcess.Finalize){switch (summaryID){case 1:e.TotalValue = customSum;break;}} }
这篇关于DevExpress GridControl SummaryItem的Custom Summary的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!