你可以通过设置以下两个属性来控制是否重置Spread原有的设置:
- fpSpread1.ActiveSheet.DataAutoCellTypes = false;
- fpSpread1.ActiveSheet.DataAutoSizeColumns = false;
复制代码
- DataTable dt = new DataTable();
- dt.Columns.Add("Col1");
- dt.Columns.Add("Col2");
- dt.Columns.Add("Col3");
- dt.Rows.Add(1,2,3);
-
- fpSpread1.ActiveSheet.DataAutoCellTypes = false;
- fpSpread1.ActiveSheet.DataAutoSizeColumns = false;
-
- FarPoint.Win.Spread.Model.DefaultSheetDataModel dm = new FarPoint.Win.Spread.Model.DefaultSheetDataModel(dt);
- fpSpread1.ActiveSheet.Models.Data = dm;
复制代码 |