void dgrdv_CellContextMenuStripNeeded(object sender, DataGridViewCellContextMenuStripNeededEventArgs e) { int irow = e.RowIndex; int icol = e.ColumnIndex; if ((irow == -1) || (icol == -1)) { return; } if (this.dgrdv.Columns[icol].DataPropertyName == "PrdID") { if (this.dgrdv[icol, irow].ReadOnly == true) { return; } this.dgrdv.CurrentCell = this.dgrdv[icol, irow]; if (frmPrd == null) { this.frmPrd = new JERPApp.Define.Product.FrmManufPrd(); new FrmStyle(this.frmPrd).SetPopFrmStyle(this); this.frmPrd.AffterSelected += frmPrd_AffterSelected; } this.frmPrd.ShowDialog(); } }
void btnAddPrd_Click(object sender, EventArgs e) { if (frmAddPrd == null) { this.frmAddPrd = new JERPApp.Define.Product.FrmManufPrd(); new FrmStyle(this.frmAddPrd).SetPopFrmStyle(this); this.frmAddPrd.AffterSelected += frmAddPrd_AffterSelected; } this.frmAddPrd.ShowDialog(); }