首页 > 代码库 > combobox联动
combobox联动
1 private void w_day_scheduling_Load(object sender, EventArgs e) 2 { 3 4 if (ls_deptname == string.Empty) 5 { 6 ds = DoctorService.getDdept(); 7 comboBoxEx1.DataSource = ds.Tables[0]; 8 comboBoxEx1.DisplayMember = "group_name"; 9 comboBoxEx1.SelectedIndex = 0; 10 comboBoxEx1.ValueMember = "group_code"; 11 ds.Dispose(); 12 } 13 }
1 private void comboBoxEx1_SelectedIndexChanged(object sender, EventArgs e) 2 { 3 if (comboBoxEx1.SelectedIndex > -1) 4 { 5 DataRowView drv = (DataRowView)comboBoxEx1.SelectedItem; 6 string ls_deptcode = drv.Row["group_code"].ToString(); 7 ds = DoctorService.getNoClass(ls_deptcode); 8 comboBoxEx2.DataSource = ds.Tables[0]; 9 comboBoxEx2.DisplayMember = "CLINIC_LABEL"; 10 } 11 }
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。