你好,可以通过 GroupDataModel 类下的 Group() 方法去添加,参考代码:
- protected void Button1_Click(object sender, EventArgs e)
- {
- FarPoint.Web.Spread.Model.GroupDataModel gm = new FarPoint.Web.Spread.Model.GroupDataModel(FpSpread1.ActiveSheetView.DataModel);
- FarPoint.Web.Spread.SortInfo[] sort = new FarPoint.Web.Spread.SortInfo[3];
- sort[0] = new FarPoint.Web.Spread.SortInfo(0, true);
- sort[1] = new FarPoint.Web.Spread.SortInfo(1,true);
- sort[2] = new FarPoint.Web.Spread.SortInfo(2, true);
- gm.Group(sort);
- FpSpread1.ActiveSheetView.DataModel = gm;
- }
复制代码 详细内容请参见 帮助文档-GroupDataModel 章节 |