DEV官网给的是直连数据库的方法,对于用代码绑定的方法还是稍微有点区别。
下面直接给出绑定的代码:
//summary字段必须是数值型啊 GridGroupSummaryItem item = new GridGroupSummaryItem(); this.bandedGridView1.Columns["check_num"].SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum; item.FieldName = this.bandedGridView1.Columns["check_num"].FieldName; item.SummaryType = DevExpress.Data.SummaryItemType.Sum; item.ShowInGroupColumnFooter = this.bandedGridView1.Columns["check_num"]; this.bandedGridView1.GroupSummary.Add(item);