Пример #1
0
        //按照班级查询
        private void btnQuery_Click(object sender, EventArgs e)
        {
            #region 数据验证
            if (this.cboClass.SelectedIndex == -1)
            {
                MessageBox.Show("请选则班级!", "提示");
                return;
            }
            #endregion

            #region 数据交互

            //接收查询数据
            list = objClassService.GetStudentsByClass(this.cboClass.Text);
            //不显示尚未封装属性
            this.dgvStudentList.AutoGenerateColumns = false;
            //绑定数据源
            this.dgvStudentList.DataSource = list;
            //修改样式显示样式
            new Common.DataGridViewStyle().DgvStyle1(this.dgvStudentList);

            #endregion
        }