You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using Enums in my application to provide easy lists/dropdown options but was really struggling to make this work in FluentUI-Blazor. I tried to figure out how to work this add this into the FluentSelect itself but got very stuck on several attempts. Instead, I ended up writing a wrapper component that takes in the Enum itself and then lets you map pass in a variable of the Enum type to get or set the selected value. Only thing left to work out is that the variable has to be nullable or else it won't work with the placeholder text.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been using Enums in my application to provide easy lists/dropdown options but was really struggling to make this work in FluentUI-Blazor. I tried to figure out how to work this add this into the FluentSelect itself but got very stuck on several attempts. Instead, I ended up writing a wrapper component that takes in the Enum itself and then lets you map pass in a variable of the Enum type to get or set the selected value. Only thing left to work out is that the variable has to be nullable or else it won't work with the placeholder text.
This is what this looks like:
Screen.Recording.2024-08-31.221531.mp4
Using this Enum:
FluentSelectEnum.razor:
and then this razor code in the final page:
Beta Was this translation helpful? Give feedback.
All reactions