private void dgvProductList_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex == -1) { return; } if (e.ColumnIndex == 3) { string productName = dgvProductList.CurrentRow.Cells[1].Value.ToString(); string procuctID = dgvProductList.CurrentRow.Cells[0].Value.ToString() +"-"+ dgvProductList.CurrentRow.Cells[2].Value.ToString(); ; AddProductPluCtl objPLU = new AddProductPluCtl(procuctID, productName); objPLU.Parent = this.ParentForm; UserControlManager.UserControls.Push(this); Panel pnl = (Panel)this.ParentForm.Controls["pnlContext"]; string s = pnl.Name; objPLU.ParentForm.Controls[s].Controls.Clear(); objPLU.ParentForm.Controls[s].Controls.Add(objPLU); } }
private void dgvProductList_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex == -1) { return; } if (e.ColumnIndex == 3) { string productName = dgvProductList.CurrentRow.Cells[1].Value.ToString(); string procuctID = dgvProductList.CurrentRow.Cells[0].Value.ToString() + "-" + dgvProductList.CurrentRow.Cells[2].Value.ToString();; AddProductPluCtl objPLU = new AddProductPluCtl(procuctID, productName); objPLU.Parent = this.ParentForm; UserControlManager.UserControls.Push(this); Panel pnl = (Panel)this.ParentForm.Controls["pnlContext"]; string s = pnl.Name; objPLU.ParentForm.Controls[s].Controls.Clear(); objPLU.ParentForm.Controls[s].Controls.Add(objPLU); } }