如何设置ComboBox 默认选中第一项

2025-02-06 11:00:14
推荐回答(1个)
回答1:

this.comboBox1.DataSource=da.DefaultView;
this.comboBox1.DisplayMember="Name";
this.comboBox1.ValueMember="id";
this.comboBox1.SelectedIndex=0;
string texts=this.comboBox1.SelectedText.ToString();;
string values=this.comboBox1.SelectedValue.ToString();