Пример #1
0
        private void changeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var toEdit = drugGridView.SelectedRows[0].DataBoundItem as Drug;

            if (toEdit != null)
            {
                var pf = new DrugForm(toEdit, directory);
                if (pf.ShowDialog() == DialogResult.OK)
                {
                }
                drugBindingSource.ResetBindings(false);
                directory.IsDirty = true;
            }
        }
Пример #2
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var pf = new DrugForm(directory);

            if (pf.ShowDialog() == DialogResult.OK)
            {
            }
            drugBindingSource.ResetBindings(false);
            directory.IsDirty = true;
            var lastIdx = drugGridView.Rows.Count - 1;

            drugGridView.Rows[lastIdx].Selected          = true;
            drugGridView.FirstDisplayedScrollingRowIndex = lastIdx;
        }