1. 为ComboBoxCell创建一个数据源
DataTable table = new DataTable();
table.Columns.Add("ID");
table.Columns.Add("Name");
table.Rows.Add(0, "女");
table.Rows.Add(1, "男");
2. 设置数据源
ComboBoxCell comboCell = new ComboBoxCell();
comboCell.DataSource = table;
comboCell.ValueMember = "ID";
comboCell.DisplayMember = "Name"; |