private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1 && e.ColumnIndex != -1) { edit = 1; MainClass.Disable(panel7); picBox.Image = null; DataGridViewRow row = dataGridView1.Rows[e.RowIndex]; staffID = Convert.ToInt32(row.Cells["userIDGV"].Value.ToString()); nameTxt.Text = row.Cells["NameGV"].Value.ToString(); usernameTxt.Text = row.Cells["UsernameGV"].Value.ToString(); passwordTxt.Text = row.Cells["PasswordGV"].Value.ToString(); confirmpasswordTxt.Text = row.Cells["PasswordGV"].Value.ToString(); phoneTxt.Text = row.Cells["PhoneGV"].Value.ToString(); roleDD.SelectedValue = row.Cells["roleIDGV"].Value.ToString(); statusDD.SelectedItem = row.Cells["StatusGV"].Value.ToString(); var im = (from x in eduvationdb.staffs where x.staff_id == staffID select x.staff_img).First(); if (im == null) { } else { byte[] arr = im.ToArray(); MemoryStream ms = new MemoryStream(arr); image = Image.FromStream(ms); picBox.Image = image; picBox.SizeMode = PictureBoxSizeMode.StretchImage; } } }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1 && e.ColumnIndex != -1) { edit = 1; MainClass.Disable(panel6); DataGridViewRow gridViewRow = dataGridView1.Rows[e.RowIndex]; subjectID = Convert.ToInt32(gridViewRow.Cells["SubjectIDGV"].Value.ToString()); subjectNameTxt.Text = gridViewRow.Cells["SubjectNameGV"].Value.ToString(); classDD.SelectedValue = gridViewRow.Cells["classidGV"].Value; } }
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex != -1 && e.ColumnIndex != -1) { edit = 1; MainClass.Disable(panel6); DataGridViewRow gridViewRow = dataGridView1.Rows[e.RowIndex]; timingID = Convert.ToInt32(gridViewRow.Cells["tIdGV"].Value.ToString()); timingNameTxt.Text = gridViewRow.Cells["timingNameGV"].Value.ToString(); classstart_TimePicker.Value = Convert.ToDateTime(gridViewRow.Cells["startGV"].Value); endclass_TimePicker.Value = Convert.ToDateTime(gridViewRow.Cells["endGV"].Value); dayDD.SelectedItem = gridViewRow.Cells["dayGV"].Value.ToString(); classDD.SelectedValue = gridViewRow.Cells["classIDGV"].Value.ToString(); } }