void Agregado_dgv_listadoCellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { //carga form datos_agregado aux = new datos_agregado(); //carga elemento del datagrid seleccionado DataGridViewRow row = agregado_dgv_listado.Rows[e.RowIndex]; //pasamos datos al nuevo form string id = row.Cells[0].Value.ToString(); string nombre = row.Cells[1].Value.ToString(); string precio = row.Cells[2].Value.ToString(); string disponible = row.Cells[3].Value.ToString(); //abre form aux.Show(); aux.cargar_datos("actualizar", nombre, precio, disponible, id); }
void Btn_agregarClick(object sender, EventArgs e) { datos_agregado aux = new datos_agregado(); aux.Show(); }