private void CatogoryName_SelectionChanged(object sender, SelectionChangedEventArgs e) { int selectedindex = CatogoryName.SelectedIndex; if (selectedindex.Equals(4) || selectedindex.Equals(5) || selectedindex.Equals(6) || selectedindex.Equals(6) || selectedindex.Equals(1)) { options.Visibility = Visibility.Hidden; } else if (selectedindex.Equals(2)) { options.Visibility = Visibility.Visible; MessageBox.Show("Select a Supplier Name from Option menu"); List <String> supplierNameList = handleDatabase.getNameListforPurchases("purchaseMaster"); options.ItemsSource = supplierNameList; } else if (selectedindex.Equals(3)) { options.Visibility = Visibility.Visible; MessageBox.Show("Select a customer Name from Option menu"); List <String> customerNameList = handleDatabase.getListDetailsforSales("customer"); options.ItemsSource = customerNameList; } }