Exemple #1
0
        private void BindChecboxList(int merchantId)
        {
            AddHeaderCheckBox();

            HeaderCheckBox.KeyUp                    += new KeyEventHandler(HeaderCheckBox_KeyUp);
            HeaderCheckBox.MouseClick               += new MouseEventHandler(HeaderCheckBox_MouseClick);
            dgvChklist.CellValueChanged             += new DataGridViewCellEventHandler(dgvSelectAll_CellValueChanged);
            dgvChklist.CurrentCellDirtyStateChanged += new EventHandler(dgvSelectAll_CurrentCellDirtyStateChanged);
            dgvChklist.CellPainting                 += new DataGridViewCellPaintingEventHandler(dgvSelectAll_CellPainting);

            _boexmmng.Event      = "GetExamWithMId";
            _boexmmng.MerchantId = merchantId;
            _boexmmnglist        = _baexmmng.SelectMerchantExamDetail(_boexmmng);

            dgvChklist.DataSource = _boexmmnglist;
            for (int i = 0; i < dgvChklist.Columns.Count; i++)
            {
                dgvChklist.Columns[i].Visible = false;
            }
            DataGridViewCheckBoxColumn checkBoxColumn = new DataGridViewCheckBoxColumn();

            checkBoxColumn.HeaderText = "";
            checkBoxColumn.Width      = 30;
            checkBoxColumn.Name       = "checkBoxColumn";
            dgvChklist.Columns.Insert(0, checkBoxColumn);
            dgvChklist.Columns[2].Visible = true;

            TotalCheckBoxes        = dgvChklist.RowCount;
            TotalCheckedCheckBoxes = 0;
        }
 private void FillMerchantExamGridview(int loginid)
 {
     _boexmmng.Event = "GetExamWithMId";
     _boexmmng.MerchantId = loginid;
     _boexmmnglist = _baexmmng.SelectMerchantExamDetail(_boexmmng);
     int tmp = 0;
     DataTable _table = new DataTable();
     _table = Common.LINQToDataTable(_boexmmnglist);
     dgvExamMerchant.Rows.Clear();
     foreach (DataRow row in _table.Rows)
     {
         dgvExamMerchant.Rows.Add();
         dgvExamMerchant.Rows[tmp].Cells[1].Value = Convert.ToString(row["ExamCodeId"]);
         dgvExamMerchant.Rows[tmp].Cells[2].Value = Convert.ToString(row["ExamCode"]);
         dgvExamMerchant.Rows[tmp].Cells[3].Value = Convert.ToString(row["SecondCategory"]);
         dgvExamMerchant.Rows[tmp].Cells[4].Value = Convert.ToString(row["TestTime"]);
         dgvExamMerchant.Rows[tmp].Cells[5].Value = Convert.ToString(row["ValidDate"]);
         tmp++;
     }
 }