private void PopulateDrugs() { DataTable dt = drug.GetAllDrugs(); foreach (DataRow row in dt.Rows) { int drugID = Convert.ToInt32(row["ID"]); String drug = row["Drug"].ToString(); drugIDs.Add(drugID); checkedListBoxDrugs.Items.Add(drug, false); } int numServices = drugIDs.Count(); checkedListBoxDrugs.Size = new Size(250, 15 * numServices); int errLabelYPos = checkedListBoxDrugs.Location.Y + (15 * numServices); labelDrugErr.Location = new Point(checkedListBoxDrugs.Location.X, errLabelYPos); labelDosage.Location = new Point(labelDrugErr.Location.X, labelDrugErr.Location.Y + 15); textBoxDosage.Location = new Point(labelDosage.Location.X, labelDosage.Location.Y + 20); labelDosageErr.Location = new Point(textBoxDosage.Location.X, textBoxDosage.Location.Y + 10); }
private void PopulateDataGridView() { DataTable dt = drug.GetAllDrugs(); dgvDrugs.DataSource = dt; }