private void dgvItemSuppliers_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e) { if (e.ColumnIndex != SupplierNameIndex) { return; } DataGridViewRow row = this.dgvItemSuppliers.CurrentCell.OwningRow; if (row == null) { return; } FrmSupplierList frm = new FrmSupplierList(SupplierDlgMode.SelectSupplier); frm.StartPosition = FormStartPosition.CenterParent; frm.ShowDialog(); if (frm.mSelectedSupplier == null) { return; } row.Cells[SupplierNameIndex].Value = frm.mSelectedSupplier.SupplierName; row.Cells[SupplierIdIndex].Value = frm.mSelectedSupplier.SupplierID; }
private void ToolStripMenuItemViewSupplier_Click(object sender, EventArgs e) { FrmSupplierList frm = new FrmSupplierList(SupplierDlgMode.ShowSupplier); frm.StartPosition = FormStartPosition.CenterScreen; frm.Show(); }
private void buttonSelectSupplier_Click(object sender, EventArgs e) { FrmSupplierList frmSupplierList = new FrmSupplierList(SupplierDlgMode.SelectSupplier); frmSupplierList.ShowDialog(); if (frmSupplierList.mSelectedSupplier != null) { mSupplier = frmSupplierList.mSelectedSupplier; this.textBoxSupplier.Text = mSupplier.SupplierName; } }