回复 1楼a1274918722的帖子
a1274918722 你好,
Spread ComboBoxCellType 设计如此,当前 Cell 的文本值不是 ComboBoxCellType 子项时,无法保留原始值。
请使用以下代码测是:
- protected void Page_Load(object sender, EventArgs e)
- {
- if (IsPostBack)
- {
- return;
- }
- FpSpread1.UseClipboard = false;
- this.FpSpread1.ActiveSheetView.Cells[0, 0].Text = "A";
- }
- protected void btnComBox_Click(object sender, EventArgs e)
- {
- FarPoint.Web.Spread.ComboBoxCellType commbox = new FarPoint.Web.Spread.ComboBoxCellType();
- string[] arr = new string[] { "A", "B" };
- commbox.DataSource = arr;
- this.FpSpread1.ActiveSheetView.Cells[0, 0].CellType = commbox;
- }
- protected void btnText_Click(object sender, EventArgs e)
- {
- FarPoint.Web.Spread.TextCellType text = new FarPoint.Web.Spread.TextCellType();
- this.FpSpread1.ActiveSheetView.Cells[0, 0].CellType = text;
- }
复制代码 |