回复 3楼shone的帖子
可以通过 ComboBoxCellType 实现,但需要刷新:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- return;
- string[]cbstr;
- string[]strval;
- cbstr=new String[]{"China","Japan","USA"};
- strval=new String[]{"1","2","3"};
- FarPoint.Web.Spread.ComboBoxCellType cb=new FarPoint.Web.Spread.ComboBoxCellType();
- cb.Items=cbstr;
- cb.AutoPostBack = true;
- cb.ShowButton = true;
- FpSpread1.Sheets[0].Columns[0].CellType=cb;
- }
- protected void FpSpread1_ButtonCommand(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- System.Drawing.Point location = (System.Drawing.Point)e.CommandArgument;
- switch (e.SheetView.Cells[location.X,location.Y].Text)
- {
- case "China":
- string[]cbstr;
- string[]strval;
- cbstr=new String[]{"ShanXi","GuangDong","FuJian"};
- strval=new String[]{"1","2","3"};
- FarPoint.Web.Spread.ComboBoxCellType cb=new FarPoint.Web.Spread.ComboBoxCellType();
- cb.Items=cbstr;
- cb.AutoPostBack = true;
- cb.ShowButton = true;
- FpSpread1.Sheets[0].Cells[0, 1].CellType = cb;
- break;
- case "Japan":
- break;
- case "USA":
- break;
- default:
- break;
- }
- }
复制代码 |