private void buttonModificare_Click(object sender, EventArgs e) { dataGridAfisare.DataSource = null; using (FereastraModificare Form = new FereastraModificare()) { this.Hide(); Form.ShowDialog(); this.Show(); } }
private void buttonModificare_Click(object sender, EventArgs e) { if (dataGridAfisare.DataSource == null) { return; } if (dataGridAfisare.CurrentCell.RowIndex == -1) { return; } using (FereastraModificare Form = new FereastraModificare((Car)dataGridAfisare.CurrentRow.DataBoundItem)) { this.Hide(); Form.ShowDialog(); this.Show(); } listAutoturismeFisier = adminAutoturisme.GetCarsFile(); dataGridAfisare.DataSource = listAutoturismeFisier; }