List<Customer> _customers = getCustomers().ToList();
BindingSource bsCustomers = new BindingSource();
bsCustomers.DataSource = _customers;
comboBox.DataSource = bsCustomers.DataSource;
comboBox.DisplayMember = "name";
comboBox.ValueMember = "id";
现在我要如何将下拉框的项目设置为列表中除第一个以外的其他项目? 尝试过 comboBox.SelectedItem = someCustomer; ...以及其他很多方法,但到目前为止都没有成功...
comboBox.SelectedValue = customerToSelect.id
。 - AdamMc331