Good morning, I have a form where I consult my budgets and in it I have a grid view
.
When I double click on the grid line it opens another form. But I do not see the data that is in the line of my grid view
the first item in my combo appears.
This is the event and code that I use to open in the other form. This form is the query:
private void dgvOrc_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
{
frmOrcDomestico formOrc = new frmOrcDomestico();
formOrc.PreencheDados(dgvOrc.SelectedRows[0].Cells[0].Value.ToString(),
dgvOrc.SelectedRows[0].Cells[1].Value.ToString(),
dgvOrc.SelectedRows[0].Cells[2].Value.ToString(),
dgvOrc.SelectedRows[0].Cells[3].Value.ToString(),
dgvOrc.SelectedRows[0].Cells[4].Value.ToString(),
dgvOrc.SelectedRows[0].Cells[5].Value.ToString(),
dgvOrc.SelectedRows[0].Cells[6].Value.ToString(),
dgvOrc.SelectedRows[0].Cells[7].Value.ToString(),
dgvOrc.SelectedRows[0].Cells[8].Value.ToString());
formOrc.ShowDialog();
}
This form is what will receive the data from the other.
public void PreencheDados(string id, string c, string p, string t, string dom, string data, string l, string d, string pg)
{
lblId.Text = id;
comboCliente.Text = c;
comboProduto.Text = p;
comboTipoProduto.Text = t;
lblDomestico.Text = dom;
lbld.Text = data;
lblStatus.Text = l;
textDescricao.Text = d;
maskValor.Text = pg;
}