string customSum = "";
private void bandedGridView1_CustomSummaryCalculate ( object sender ,DevExpress.Data.CustomSummaryEventArgs e )
{
int summaryId = Convert.ToInt32( ( e.Item as GridSummaryItem ).Tag );
GridView View = sender as GridView;
// Initialization
if ( e.SummaryProcess == CustomSummaryProcess.Start )
{
customSum = "";
}
// Calculation
if ( e.SummaryProcess == CustomSummaryProcess.Calculate )
{
customSum = "123";
}
// Finalization
if ( e.SummaryProcess == CustomSummaryProcess.Finalize )
{
switch ( summaryId )
{
case 1:
e.TotalValue = customSum;
break;
}
}
}
GridControl分组小计自定义计算公式:
1、设置自定义分组
2、设置分组字段自定义计算
3、后台写自定义计算公式以及赋值给对应的分组字段