private void frmListVendors_Load(object sender, EventArgs e) { List <Vendor> vendors = VendorDB.GetAllVendors(); vendorBindingSource.DataSource = vendors; _cm = (CurrencyManager) vendorDataGridView.BindingContext[vendors]; }
private void mnuAddNewVendor_Click(object sender, EventArgs e) { frmAddModifyVendor frmChild = new frmAddModifyVendor(); this.AddOwnedForm(frmChild); if (frmChild.ShowDialog() == DialogResult.OK) { vendorBindingSource.DataSource = VendorDB.GetAllVendors(); } }
private void mnuModifyVendor_Click(object sender, EventArgs e) { // retrieve the current Vendor Vendor vendor = (Vendor)vendorBindingSource.Current; // display vendor form frmAddModifyVendor frmChild = new frmAddModifyVendor(); frmChild.vendor = vendor; this.AddOwnedForm(frmChild); if (frmChild.ShowDialog() == DialogResult.OK) { vendorBindingSource.DataSource = VendorDB.GetAllVendors(); } }