首页 > 其他 > 详细

combobox联动

时间:2014-05-06 10:32:14      阅读:416      评论:0      收藏:0      [点我收藏+]
 
bubuko.com,布布扣
 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         }
View Code
bubuko.com,布布扣
 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         }
View Code

 

combobox联动,布布扣,bubuko.com

combobox联动

原文:http://www.cnblogs.com/lvk618/p/3710677.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!