private void tsbAddNewVendor_Click(object sender, EventArgs e) { System.Data.DataRow new_vendor = this.vendors.NewRow(); VendorForm vfrm = new VendorForm( this.cConnection, ref new_vendor ); if (vfrm.ShowDialog() == DialogResult.OK){ this.vendors.Rows.Add( new_vendor ); this.AddNewRow(this.vendors.Rows.Count, new_vendor ); } return; }
private void lvVendors_ItemActivate(object sender, EventArgs e) { if (this.lvVendors.SelectedItems.Count > 0){ int idx = this.lvVendors.SelectedItems[0].Index; System.Data.DataRow drw = this.vendors.Rows[idx]; VendorForm vf = new VendorForm(this.cConnection, ref drw); if (vf.ShowDialog() == DialogResult.OK){ } } }