你好,只要把cellType设置到列上,再把第一行单独设置为Text格式即可,如下代码所示:
- var sheet = spread.getActiveSheet();
- var combo = new GC.Spread.Sheets.CellTypes.ComboBox();
- combo.items([{ text: "Oranges", value: "11k" }, { text: "Apples", value: "15k" }, { text: "Grape", value: "100k" }])
- .editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text);
- sheet.getRange(-1, 0, GC.Spread.Sheets.SheetArea.viewport).cellType(combo);
- sheet.setCellType(0,0,new GC.Spread.Sheets.CellTypes.Text());
复制代码 |