private void dgvWorkersList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { //workersListDG.Rows[e.RowIndex].Cells['id'].Value WorkerCard wc = new WorkerCard(dgvWorkersList.Rows[e.RowIndex].Cells[0].Value.ToString()); wc.ShowDialog(); }
private void btnAddWorker_Click(object sender, EventArgs e) { WorkerCard wc = new WorkerCard(); wc.ShowDialog(); List <String[]> workers = okDB.getWorkersList(); dgvWorkersList.Rows.Clear(); for (int i = 0; i < workers.Count; i++) { dgvWorkersList.Rows.Add(workers[i][1], workers[i][0]); } }
private void btnWorkerCard_Click(object sender, EventArgs e) { if (dgvWorkersList.SelectedRows.Count == 1) { int row = dgvWorkersList.SelectedRows[0].Index; WorkerCard wc = new WorkerCard(dgvWorkersList.Rows[row].Cells[0].Value.ToString()); wc.ShowDialog(); } else { MessageBox.Show("Необходимо выбрать в таблице запись"); } }