private void toolStripMenuItem16_Click(object sender, EventArgs e) { var editTool = dataGridViewShop.SelectedRows[0].DataBoundItem as CommissionShop; AddCommissionShopForm adcsf = new AddCommissionShopForm(editTool); if (adcsf.ShowDialog() == DialogResult.OK) { commissionShopBindingSource.ResetBindings(false); art.isChangeData = true; } }
private void button1_Click(object sender, EventArgs e) { if (adc.ShowDialog() == DialogResult.OK) { art.AddComShop(adc.comshop); commissionShopBindingSource.ResetBindings(false); art.isChangeData = true; var lastIdx = dataGridViewShop.Rows.Count - 1; dataGridViewShop.Rows[lastIdx].Selected = true; dataGridViewShop.FirstDisplayedScrollingRowIndex = lastIdx; } }