或者直接给datamodal插入 列 参考如下代码
- private void button2_Click(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.Model.GroupDataModel gm;
- if ((fpSpread1.ActiveSheet.Models.Data) is FarPoint.Win.Spread.Model.GroupDataModel)
- {
- gm = (FarPoint.Win.Spread.Model.GroupDataModel)fpSpread1.ActiveSheet.Models.Data;
- int i;
- i = gm.ColumnCount;
- var tm = gm.TargetModel as FarPoint.Win.Spread.Model.DefaultSheetDataModel;
- tm.AddColumns(1, 2);
- MessageBox.Show(i.ToString());
- }
- }
复制代码 |