1金币
需求如下:
当鼠标点击某个单元格后,设置该单元格类型为下拉框进行选择(要能自动展开,不要点击2次),当焦点发生变更或者活动单元格发生变更后原单元格恢复正常正常文本显示,并设置其值为刚才下拉框选择的值.
我在EnterCell事件中完成了单元格类型设置,但却不知道如何恢复并完成值传递,请教下如何实现?
private void fpSpread1_EnterCell(object sender, EnterCellEventArgs e)
{
FarPoint.Win.Spread.CellType.ComboBoxCellType cmb = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
ListBox lb = new ListBox();
lb.Items.Add("办公设备");
lb.Items.Add("IT设备");
lb.Items.Add("其它设备");
cmb.ListControl = lb;
fpSpread1.Sheets[0].Cells[e.Row, e.Column].CellType = cmb;
}
|
|