/// <summary> /// Function to fill the DtaGridview With Batch While Updating /// </summary> public void OpeningStockGridWithBathFill() { try { List<DataTable> listObj = new List<DataTable>(); ProductCreationBll BllProductCreation = new ProductCreationBll(); BatchBll BllBatch = new BatchBll(); cmbAllowBatch.SelectedIndex = 1; isBatchForUpdate = true; listObj = BllProductCreation.ProductViewGridFillFromBatch(decProductIdForEdit); for (int i = 0; i < listObj[0].Rows.Count; i++) { dgvProductCreation.Rows[i].Cells["dgvtxtbatchId"].Value = Convert.ToDecimal(listObj[0].Rows[i]["batchId"]); dgvProductCreation.Rows[i].Cells["dgvtxtExpDate"].Value = listObj[0].Rows[i]["expiryDate"]; dgvProductCreation.Rows[i].Cells["dgvtxManfDate"].Value = listObj[0].Rows[i]["manufacturingDate"]; dgvProductCreation.Rows[i].Cells["dgvtxtbatch"].Value = listObj[0].Rows[i]["batchNo"]; } 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[1]; } catch (Exception ex) { MessageBox.Show("PC:4" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }