1、设置下拉数据
List<string> alist = new List<string>();
foreach (DataRow item in dt.Rows)
{
添加alist;
}
2、设置combobox对象
SourceGrid.Cells.Editors.ComboBox cbeditor= new SourceGrid.Cells.Editors.ComboBox(typeof(string));
cbeditor.StandardValues = alist ;
cbeditor.EditableMode = SourceGrid.EditableMode.SingleClick| SourceGrid.EditableMode.Focus;//点击显示下拉列表
grid1[1, 1] = new SourceGrid.Cells.Cell("", cbeditor);
cbeditor.Control.DropDownStyle = ComboBoxStyle.DropDownList; //设置下拉框为不可以编辑的状态
3、注意:如果在循环中设置某个cell时,需要每次循环都初始化一下cbeditor,并赋给cell;