您好!
1、监听下拉框值改变可以用ValueChanged事件,如代码所示:
- var spread = GC.Spread.Sheets.findControl("ss");
- var sheet = spread.getActiveSheet();
- sheet.bind(GC.Spread.Sheets.Events.ValueChanged, function (sender, args) {
- var cellType = args.sheet.getCellType(args.row,args.col);
- if(cellType && cellType instanceof GC.Spread.Sheets.CellTypes.ComboBox){
- console.log(args);
- }
- });
复制代码
2、直接设置成value即可,如学习指南示例所示:
https://demo.grapecity.com.cn/Sp ... mboBoxCellType.html
如果一定要设置成text,那只能从ValueChanged中获取cellType实例,然后再获取对应的items,
再获取对应的value,如图所示:
|