/// <summary> /// Function to fill the datagridview while updating /// </summary> public void OpeningStockGridFill() { try { StockPostingBll BllStockPosting = new StockPostingBll(); ProductCreationBll BllProductCreation = new ProductCreationBll(); List<DataTable> listObj = new List<DataTable>(); listObj = BllProductCreation.ProductViewGridFillFromStockPosting(decProductIdForEdit); UnitComboInsideGridFill(); dgvProductCreation.Rows.Clear(); for (int i = 0; i < listObj[0].Rows.Count; i++) { dgvProductCreation.Rows.Add(); dgvProductCreation.Rows[i].Cells["dgvtxtstockpostId"].Value = listObj[0].Rows[i]["stockPostingId"]; dgvProductCreation.Rows[i].Cells["dgvtxtqty"].Value = listObj[0].Rows[i]["inwardQty"]; dgvProductCreation.Rows[i].Cells["dgvtxtrate"].Value = listObj[0].Rows[i]["rate"]; dgvProductCreation.Rows[i].Cells["dgvcmbtgodown"].Value = listObj[0].Rows[i]["godownId"]; dgvProductCreation.Rows[i].Cells["dgvcmbrack"].Value = listObj[0].Rows[i]["rackId"]; dgvProductCreation.Rows[i].Cells["dgvcmbUnit"].Value = listObj[0].Rows[i]["unitId"]; } foreach (DataGridViewRow dgvRowObj in dgvProductCreation.Rows) { if (!dgvRowObj.IsNewRow) { DataGridViewCellEventArgs dgvArg = new DataGridViewCellEventArgs(0, dgvRowObj.Index); CheckingForIncompleteRowInGrid(dgvArg); } } dgvProductCreation.Focus(); dgvProductCreation.CurrentCell = dgvProductCreation.Rows[0].Cells[0]; } catch (Exception ex) { MessageBox.Show("PC:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }