回复 1楼cqtk的帖子
cqtk 你好,
由于 Spread 在保存 Excel 格式文件时,取的是单元格对应的 value 值,所以导出为地址代码,解决方法如下:
- FarPoint.Win.Spread.CellType.ComboBoxCellType combo = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
- private void Form1_Load(object sender, EventArgs e)
- {
- string[] cbstr;
- cbstr = new String[] { "One", "Two", "Three" };
- string[] strval;
- strval = new String[] { "0", "1", "2" };
- combo.Items = cbstr;
- combo.ItemData = strval;
- combo.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData;
- fpSpread1.Sheets[0].Cells[0, 0].CellType = combo;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- combo.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.String;
- fpSpread1.SaveExcel(@"c:\celltype.xls");
- }
复制代码 |