sxjcjwl 你好,下面以 Cell[0,0] 为例实现 ComboboxCellType 单元格类型的 Items 和 Cell Text 同步。这是我实现的代码:
- FarPoint.Web.Spread.ComboBoxCellType comboboxType = new FarPoint.Web.Spread.ComboBoxCellType();
- protected void Page_Load(object sender, EventArgs e)
- {
- this.FpSpread1.ActiveSheetView.AutoPostBack = true;
- FpSpread1.ActiveSheetView.Cells[0, 0].Text = "1";
- FpSpread1.ActiveSheetView.Cells[0, 0].CellType = comboboxType;
- }
- //在 CellClick 事件中实现文本与单元格值的绑定
- private void GetItems(FarPoint.Web.Spread.FpSpread spread, protected void FpSpread1_CellClick(object sender, FarPoint.Web.Spread.SpreadCommandEventArgs e)
- {
- string item = this.FpSpread1.ActiveSheetView.Cells[0, 0].Text;
- string[] array = new string[1] { item };
- comboboxType.Items = array;
- }
复制代码 |