private void buttonX1_Click(object sender, EventArgs e) { FRM_CUSTOMER_LIST frm = new FRM_CUSTOMER_LIST(); frm.ShowDialog(); if (frm.DGVCUSTOMER.CurrentRow.Cells[5].Value is DBNull) { this.txtcustomerid.Text = frm.DGVCUSTOMER.CurrentRow.Cells[0].Value.ToString(); this.txtfirstname.Text = frm.DGVCUSTOMER.CurrentRow.Cells[1].Value.ToString(); this.txtlastname.Text = frm.DGVCUSTOMER.CurrentRow.Cells[2].Value.ToString(); this.txttel.Text = frm.DGVCUSTOMER.CurrentRow.Cells[3].Value.ToString(); this.txtemail.Text = frm.DGVCUSTOMER.CurrentRow.Cells[4].Value.ToString(); pictureBox1.Image = null; return; } this.txtcustomerid.Text = frm.DGVCUSTOMER.CurrentRow.Cells[0].Value.ToString(); this.txtfirstname.Text = frm.DGVCUSTOMER.CurrentRow.Cells[1].Value.ToString(); this.txtlastname.Text = frm.DGVCUSTOMER.CurrentRow.Cells[2].Value.ToString(); this.txttel.Text = frm.DGVCUSTOMER.CurrentRow.Cells[3].Value.ToString(); this.txtemail.Text = frm.DGVCUSTOMER.CurrentRow.Cells[4].Value.ToString(); byte[] custpicture = (byte[])frm.DGVCUSTOMER.CurrentRow.Cells[5].Value; MemoryStream ms = new MemoryStream(custpicture); pictureBox1.Image = Image.FromStream(ms); }
private void button1_Click(object sender, EventArgs e) { FRM_CUSTOMER_LIST frm = new FRM_CUSTOMER_LIST(); frm.ShowDialog(); this.txtcustomerid.Text = frm.DGVCUSTOMER.CurrentRow.Cells[0].Value.ToString(); this.txtfirstname.Text = frm.DGVCUSTOMER.CurrentRow.Cells[1].Value.ToString(); this.txtlastname.Text = frm.DGVCUSTOMER.CurrentRow.Cells[2].Value.ToString(); this.txttel.Text = frm.DGVCUSTOMER.CurrentRow.Cells[3].Value.ToString(); this.txtemail.Text = frm.DGVCUSTOMER.CurrentRow.Cells[4].Value.ToString(); }