I have a datagrid with data and when I call dataGridView1_CellDoubleClick i want to fill data from datagrif to the form. There is a code :
public Product something {get; set;}
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e){
int id = (int)dataGridView1.SelectedRows[0].Cells[0].Value;
something = Podatci.GetproductByID(id);
FrmNewForm a = new FrmNewForm();
a.Show();
and logicly when i open a new form it is empty
How to access objects like textboxes from form that is open
You can pass
somethingto a new constructor of the form and show it there:Add to the form:
When you create it: