lzh3452 你好,
1.可以通过设置对应 Cell 的 Text 属性设置选择项。
2.可以通过 EditChange 事件获取相关属性。
- private void Form1_Load(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.CellType.ComboBoxCellType cmbocell1 = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
- cmbocell1.Items = (new String[] { "January", "February", "March", "April", "May", "June" });
- fpSpread1.Sheets[0].Cells[1, 1].CellType = cmbocell1;
- this.fpSpread1.Sheets[0].Cells[1, 1].Text = "March";
- }
- private void fpSpread1_EditChange(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
- {
- string selectText = "";
- int selectIndex = 0;
- if (e.Column == 2 && e.Row == 2)
- {
- FarPoint.Win.FpCombo test = e.EditingControl as FarPoint.Win.FpCombo;
- selectText = test.SelectedText;
- selectIndex = test.SelectedIndex;
- }
- }
复制代码 |