用斑竹的方法分组和取消分组都解决了,现在还有一个就是在设置分组脚中公式的出现了问题,我指定默认的是第2列分组,但是初始的分组时,分组脚中公式都出不来,等我双击第一分组时,公式的合计值才出现了,但是合计中的“合计:”汉字也没有,代码我粘贴下
DefaultGroupFooter dgf = fpSpread1_Sheet1.DefaultGroupFooter[0];
ISheetDataModel dataModel = dgf.DataModel;
FarPoint.Win.Spread.CellType.TextCellType a = new TextCellType();
this.fpSpread1_Sheet1.Columns.Get(0).CellType = a;
//设置分组脚中公式
// (dataModel as IAggregationSupport).SetCellAggregationType(0, 0, AggregationType.Count);
//(dataModel as IAggregationSupport).SetCellAggregationFormat(0, 0, "数量:{0}");
// (dataModel as IAggregationSupport).SetCellAggregationType(0, 5, AggregationType.Sum);
//(dataModel as IAggregationSupport).SetCellAggregationFormat(0, 5, "合计:{0}");
//fpSpread1_Sheet1.GroupFooterVisible = true; |