private void PopulateGrid() { if (IsReady) { if (cboStores.EditValue != null) { int storeId = (cboStores.EditValue != null) ? Convert.ToInt32(cboStores.EditValue) : 1; var recDoc = new ReceiveDoc(); var dtBal = new DataTable(); switch (VisibilitySetting.HandleUnits) { case 1: dtBal = (DataTable)recDoc.GetItemsWithPrice(storeId, Convert.ToInt32(lkCommodityTypes.EditValue)); break; case 2: dtBal = (DataTable)recDoc.GetItemsWithPrice(storeId, Convert.ToInt32(lkCommodityTypes.EditValue)); break; default: dtBal = (DataTable)recDoc.GetItemsWithPrice(storeId, Convert.ToInt32(lkCommodityTypes.EditValue)); break; } gridItemsChoice.DataSource = dtBal; } } }