Ejemplo n.º 1
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            if (dgvBillDetail.Columns.Count >= 5)
            {
                dgvBillDetail.Columns.RemoveAt(5);
            }
            dgvBillDetail.DataSource = "";
            dgvBillDetail.DataSource = BillDAL.GetRevenueDetails();
            DataGridViewButtonColumn btnViewColumn = new DataGridViewButtonColumn();

            btnViewColumn.Name       = "btnViewColumn";
            btnViewColumn.HeaderText = "Chi Tiết Hóa Đơn";
            btnViewColumn.UseColumnTextForButtonValue = true;
            btnViewColumn.Text = "Xem";
            dgvBillDetail.Columns.Add(btnViewColumn);
        }
Ejemplo n.º 2
0
 private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (tabControl1.SelectedIndex == 1)
     {
         if (dgvBillDetail.Columns.Count >= 5)
         {
             dgvBillDetail.Columns.RemoveAt(5);
         }
         dgvBillDetail.DataSource = "";
         btnBack.Enabled          = true;
         dgvBillDetail.DataSource = BillDAL.GetRevenueDetails();
         DataGridViewButtonColumn btnViewColumn = new DataGridViewButtonColumn();
         btnViewColumn.Name       = "btnViewColumn";
         btnViewColumn.HeaderText = "Chi Tiết Hóa Đơn";
         btnViewColumn.UseColumnTextForButtonValue = true;
         btnViewColumn.Text = "Xem";
         dgvBillDetail.Columns.Add(btnViewColumn);
     }
     else
     {
         btnBack.Enabled = false;
     }
 }