3
Good morning, I have a form where I consult my budgets and in it I own 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
appears the first item of my combo.
This is the event and the code 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 the one that 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;
}
I put this command, but still do not show my grid view data in my combo. Still appears the first item in the combo list
– TMBruhTH
Already tried comboTipoProduct.Selectedvalue = p or comboTipoProduct.Selectedtext = p ? I guess that’s it then. You need to see how the Combox is configured
– user26552
Still the same thing, I’ve already put the two modes and appears the first item in the combo list
– TMBruhTH