MultiColumnComboBoxCellType 实现下拉表单
问题描述:能否在点击单元格时,根据当前单元格信息,弹出其相对应的数据库子表单。问题解答:MultiColumnComboBoxCellType 单元格类型可以绑定DataTable,并且以下拉框方式显示。
关键代码:
//设置 MultiColumnComboBoxCellType
FarPoint.Win.Spread.CellType.MultiColumnComboBoxCellType mcb = new FarPoint.Win.Spread.CellType.MultiColumnComboBoxCellType();
mcb.DataSourceList = dt;
mcb.DataColumn = 2;
mcb.ColumnEdit = 2;
mcb.ButtonAlign = FarPoint.Win.ButtonAlign.Left;
mcb.ListAlignment = FarPoint.Win.ListAlignment.Right;
mcb.ListWidth = 500;
mcb.ListOffset = 5;
mcb.MaxDrop = 5;
fpSpread1.ActiveSheet.Cells.CellType = mcb;
?
效果截图:
示例下载:点击下载
页:
[1]