private void categoryComboBox_SelectionChangeCommitted(object sender, EventArgs e) { if (categoryComboBox.SelectedItem.ToString() == "-Select Category Name-") { MessageBox.Show("Please Select Category Name"); return; } category.Id = Int32.Parse(categoryComboBox.SelectedValue.ToString()); productComboBox.DataSource = _purchaseManager.CatagoryWiseProductDisplay(category); productComboBox.DisplayMember = "ProductName"; productComboBox.ValueMember = "Id"; productComboBox.Text = "--Select Product Name--"; }