首页 > 代码库 > combobox添加选项

combobox添加选项

如果不需要绑定字段,只需要显示列表

cmb_Type.Items.AddRange(new object[] {"姓名","年龄","性别"});

 

Datatable dt = getDataTable();

cmb_Type.Displayname = column1;

cmb_Type.ValueMember = column2;

cmb_Type.DataSource = dt