How to display only certain values of the enumerator in the dropdown?
There is an entity with 2 enumerator parameters, “category” and “subcategory”. There is a form with 2 dropdowns, when a user selects a “category”, in the “subcategory” dropdown he should see only those options which are relevant to the category he selected (not all of them). How can I display only certain values of the enumerator in the “subcategory” dropdown, depending on whichvalue has been selected for “category” dropdown?
- Instead of using a enum, you could create an entity and associate it to your main entity. That way, your category and subcategory will be maintainable in your application and you can constrain the drop-down to your liking.