private void PopulateDropDown() { try { cbCat.DataSource = ProductClass.PopulateDropDown().Tables[0].DefaultView; cbCat.DisplayMember = "Name"; cbCat.ValueMember = "CatID"; } catch (Exception ex) { MetroMessageBox.Show(this, "Error while getting category list\nDetails: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private void PopulateDropDown() { cboCat.DataSource = ProductClass.PopulateDropDown().Tables[0].DefaultView; cboCat.DisplayMember = "Name"; cboCat.ValueMember = "CatID"; }