private void btAdd_Click(object sender, EventArgs e) { AddForm addForm = new AddForm(sr); addForm.StudentAddedEvent += this.RefreshView; addForm.Show(this); }
/// <summary> /// Persists the changes of the DataGridView on an XML /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btAdd_Click_1(object sender, EventArgs e) { addForm = new AddForm(); addForm.StudentAdded += new StudentAddedHandler(this.RefreshDataGrid); // Importante suscribir el metodo que queremos directamente desde el metodo que lanza el segundo evento addForm.Show(); }