private void dbgrdPersons_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e) { bool newRowAddedByUser = e.RowIndex > personBindingSource.Count - 1 ? true : false; if (newRowAddedByUser) { PersonRowAdded?.Invoke(sender, e); } }
private void LinkNewlyAddedPersonRowToCurrentClan(object sender, DataGridViewRowsAddedEventArgs e) { bool newRowAddedByUser = e.RowIndex > personBindingSource.Count - 1 ? true : false; if (newRowAddedByUser) { Clan obj = clanBindingSource.Current as Clan; if (obj != null) { if (personBindingSource.Current != null) { ((Person)personBindingSource.Current).Clan = obj; } } PersonRowAdded?.Invoke(sender, e); } }