DevExpress gridcontrol 分組顯示
效果圖
設置默認分組列
gridView.Columns["類別"].GroupIndex = 0;
在分組欄後添加統計項
gridView.GroupSummary.Add(DevExpress.Data.SummaryItemType.Count, "類別");
gridView.GroupFormat = "{1} {2}"; //默認"{0}: [#image]{1} {2}"; 字段名稱:數據 計數=?
在某一列下添加統計項
gridView.GroupSummary.Add(DevExpress.Data.SummaryItemType.Count, "工作項", gridView.Columns["工作項"]);
gridView.GroupSummary[gridView.GroupSummary.Count - 1].DisplayFormat = "小計:{0:N0}";
展開所有分組
gridView.OptionsBehavior.AutoExpandAllGroups = true;