예제 #1
0
        private void dbgrdPersons_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
        {
            bool newRowAddedByUser = e.RowIndex > personBindingSource.Count - 1 ? true : false;

            if (newRowAddedByUser)
            {
                PersonRowAdded?.Invoke(sender, e);
            }
        }
예제 #2
0
        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);
            }
        }