private void btnAdjustment_Click(object sender, EventArgs e) { object item = (DataRowView)this.customer_transBindingSource.AddNew(); // Sort the customer transactions by transaction ID desc dataGridView2.Sort(dataGridView2.Columns[0], ListSortDirection.Descending); using (Form f = new AdjustmentEdit(item, customerBindingSource.Current)) { if (f.ShowDialog() == DialogResult.OK) { this.customer_transBindingSource.EndEdit(); this.customerBindingSource.ResetCurrentItem(); //this.customer_transBindingSource.ResetCurrentItem(); this.customer_transTableAdapter.Update(this.dataSet2.customer_trans); } } this.customer_transTableAdapter.Fill(this.dataSet2.customer_trans); this.iNVOICE_HEADERTableAdapter.Fill(this.dataSet2.INVOICE_HEADER); // Sort the customer transactions by transaction ID desc dataGridView2.Sort(dataGridView2.Columns[0], ListSortDirection.Descending); this.toolStrip2.Focus(); searchValue.Focus(); searchValue.SelectAll(); }
private void customer_transDataGridView_DoubleClick(object sender, EventArgs e) { object item = (DataRowView)this.customer_transBindingSource.Current; using (Form f = new AdjustmentEdit(item, customerBindingSource.Current)) { f.ShowDialog(); } this.customer_transTableAdapter.Fill(this.dataSet2.customer_trans); }