Example #1
0
        private void LoadFindCategoryComboBox()
        {
            List <CategoryModel> categories = new List <CategoryModel>();

            //Combo box selection option. If the user wants to search for a product in all categories,
            //<ALL> can be chosen.
            CategoryModel category = new CategoryModel();

            category.Id   = 0;
            category.Name = "<ALL>";

            //Load Combo Boxes. Add <ALL> option at the beginning of list.
            categories = SqliteDACategory.GetSubcategoryOnly();
            categories.Insert(0, category);
            findCategoryComboBox.DataSource    = categories;
            findCategoryComboBox.ValueMember   = "Id";
            findCategoryComboBox.DisplayMember = "Name";

            //Default Selected Index
            findCategoryComboBox.SelectedIndex = 0;
            findCategoryComboBox.SelectedIndex = 0;
        }
Example #2
0
 private void LoadNewCategoryComboBox()
 {
     newCategoryComboBox.DataSource    = SqliteDACategory.GetSubcategoryOnly();
     newCategoryComboBox.DisplayMember = "Name";
     newCategoryComboBox.ValueMember   = "Id";
 }