gridView.OptionsView.ShowFooter = true;//启用显示页脚
//索引为1的列
gridView.Columns[1].SummaryItem.DisplayFormat = "{0}";
gridView.Columns[1].SummaryItem.FieldName = "奖励次数";//列对应的列名--"奖励次数"
gridView.Columns[1].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;//求和
//索引为2的列
gridView.Columns[2].SummaryItem.DisplayFormat = "{0}";
gridView.Columns[2].SummaryItem.FieldName = "奖励金额";//列对应的列名--"奖励金额"
gridView.Columns[2].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum;//求和
gridView.CustomDrawFooterCell += new FooterCellCustomDrawEventHandler(this.gridView_CustomDrawFooterCell);//设置一下对齐方式,通过GridView的CustomDrawFooterCell 事件
/// <summary>
/// 绘制页脚时发生
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void gridView_CustomDrawFooterCell(object sender, FooterCellCustomDrawEventArgs e)
{
e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Near;//左对齐
}