当使用SelectedIndexChanged时,ValueMember在DataSource前进行赋值,
comcobox.ValueMember = "value";
comcobox.DisplayMember = "name";
comcobox.DataSource = dt1;
当使用SelectedValueChanged时,ValueMember在DataSource后进行赋值。
comcobox.DataSource = dt1;
comcobox.ValueMember = "value";
comcobox.DisplayMember = "name";
网友评论