示例#1
0
 public FrmScoreManage()
 {
     InitializeComponent();
     //断开下拉框事件
     this.cboClass.SelectedIndexChanged -= new EventHandler(this.cboClass_SelectedIndexChanged);
     //初始化班级列表
     this.cboClass.DataSource = objScoreService.GetAllClasses();
     //设置下拉框显示内容
     this.cboClass.DisplayMember = "ClassName";
     this.cboClass.ValueMember   = "ClassId";
     this.cboClass.SelectedIndex = -1;
     //恢复下拉框事件
     this.cboClass.SelectedIndexChanged += new EventHandler(this.cboClass_SelectedIndexChanged);
 }