A dropdown populated with values found in an enumeration can be a quick and efficient component. Quick in that it doesn’t take long to code (no need to write database access code to populate the list) and efficient because all the values are in memory (no resources are expended to fetch the list values). I believe binding the string value to a property would be the most common use case however sometimes you might want to bind the integer value …
Month: November 2022
Wouldn’t it be handy to have a dropdown component that is populated with all the elements of an enum (enumeration type) simply by providing the component the enum type? Of course it would! That’s why I created one. This version (SelectEnumBindText) allows binding to the text element of the selected enum. That is if you need the name or description from the enum to be bound to some value then this is the component for you. If you wrap the …
Reference tables, also referred to as type tables or lookup tables, are typically small tables containing slow changing or static data like a list of countries, address types (billing, mailing, shipping), or phone number types (home, mobile, work). There tends to be many reference tables in well normalized enterprise application databases. Some are static so no UI is needed to maintain them. Others require some occasional updates. For this last group it’s good to have a UI available for the …
Sometimes we want to bind a value in an element with a property in the component and also have the element’s onchange event trigger a method in the component. Why would we want to do this? Because sometimes we need to save the user’s input and also use it to do something else like filter a list or trigger a method in the parent component. To both bind to a property and call a method with the onchange event, the …
I’ve made all the component and example code that I have produced for the blog available through the Blazor Component Authority demonstration application. With the app it’s possible to look at live examples and see the code next to it. I think this makes it much easier to find what you’re looking for and also see how to apply it. I have a few more improvements planned for the demonstration application but I didn’t want to delay releasing what I …