wangleiecho 你好,可以通过以下方式实现- private void Form1_Load(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.CellType.ComboBoxCellType comboBoxCellType1 = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
- comboBoxCellType1.Items = (new String[] { "1", "2", });
- fpSpread1.Sheets[0].Cells[2, 1].CellType = comboBoxCellType1;
- comboBoxCellType1.EditorValueChanged += new EventHandler(comboBoxCellType1_EditorValueChanged);
- FarPoint.Win.Spread.CellType.ComboBoxCellType comboBoxCellType2 = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
- comboBoxCellType2.Items = (new String[] { "1", "2", });
- fpSpread1.Sheets[0].Cells[2, 2].CellType = comboBoxCellType2;
- }
- void comboBoxCellType1_EditorValueChanged(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.CellType.ComboBoxCellType test = sender as FarPoint.Win.Spread.CellType.ComboBoxCellType;
- if (this.fpSpread1.Sheets[0].Cells[2,1].Text=="1")
- {
- this.fpSpread1.Sheets[0].Cells[2, 2].Locked = true;
- }
- if (this.fpSpread1.Sheets[0].Cells[2, 1].Text == "2")
- {
- this.fpSpread1.Sheets[0].Cells[2, 2].Locked = false;
- }
- }
复制代码 |