I want datagridview value to appear on 'new entry forms' (textboxes but also combobox) when I click on it.
This is my code which works but only for textboxes because i don't know how to get GENDER value 'out from' datagridview back to combobox.
My combobox values are "M" and "F" and i know how to enter them into datagridview but the other way round is problem.
private void dataGridViewKontakti_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
lblID.Visible = true;
lblIDPromjena.Visible = true;
int i;
i = dataGridViewKontakti.SelectedCells[0].RowIndex;
lblIDPromjena.Text = dataGridViewKontakti.Rows[i].Cells[0].Value.ToString();
textBoxIme.Text = dataGridViewKontakti.Rows[i].Cells[1].Value.ToString();
textBoxPrezime.Text = dataGridViewKontakti.Rows[i].Cells[2].Value.ToString();
textBoxZvanje.Text = dataGridViewKontakti.Rows[i].Cells[3].Value.ToString();
textBoxZanimanje.Text = dataGridViewKontakti.Rows[i].Cells[4].Value.ToString();
textBoxTelefon.Text = dataGridViewKontakti.Rows[i].Cells[6].Value.ToString();
textBoxAdresa.Text = dataGridViewKontakti.Rows[i].Cells[7].Value.ToString();
textBoxPost.Text = dataGridViewKontakti.Rows[i].Cells[8].Value.ToString();
textBoxGrad.Text = dataGridViewKontakti.Rows[i].Cells[9].Value.ToString();
textBoxEmail.Text = dataGridViewKontakti.Rows[i].Cells[10].Value.ToString();
You'l see the empty space between cells 4 and 6. Cell 5 is my GENDER cell.