Пример #1
0
        private void toolStripMenuItem3_Click(object sender, EventArgs e)
        {
            var           editTool = dataGridViewArtist.SelectedRows[0].DataBoundItem as Artist;
            AddArtistForm arf      = new AddArtistForm(editTool);

            if (arf.ShowDialog() == DialogResult.OK)
            {
                artistBindingSource.ResetBindings(false);
                art.isChangeData = true;
            }
        }
Пример #2
0
        private void toolStripMenuItem4_Click(object sender, EventArgs e)
        {
            AddArtistForm addf = new AddArtistForm();

            if (addf.ShowDialog() == DialogResult.OK)
            {
                art.AddArtist(addf.artist);
                artistBindingSource.ResetBindings(false);
                art.isChangeData = true;
                var lastIdx = dataGridViewArtist.Rows.Count - 1;
                dataGridViewArtist.Rows[lastIdx].Selected          = true;
                dataGridViewArtist.FirstDisplayedScrollingRowIndex = lastIdx;
            }
        }