Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show friendly enumeration item names #405

Closed
JornWildt opened this issue Mar 13, 2021 · 2 comments
Closed

Show friendly enumeration item names #405

JornWildt opened this issue Mar 13, 2021 · 2 comments
Milestone

Comments

@JornWildt
Copy link

I have a booking state enumeration BookingStateType and use this for a DataModel:

[Display(Name = "Bookingstatus")]
[SelectList(typeof(BookingStateType))]
public BookingStateType BookingState { get; set; }

Now I would like the booking state to show up as a friendly name in the admin system, so I add Description attributes to it (in Danish) :

public enum BookingStateType { 
  [Description("Forespørgsel")]
  Requested,

  [Description("Bekræftet")]
  Confirmed,

  [Description("Aflyst")]
  Cancelled
}

Unfortunately the admin section still shows the code names "Requested" etc. in the selected-list.

Please look for Description attributes and their values when showing select lists (and other UI forms).

@HeyJoel HeyJoel added this to the 0.10 milestone Mar 14, 2021
@HeyJoel
Copy link
Member

HeyJoel commented Mar 14, 2021

I'm sure we can add that. For now you should be able to use IListOptionSource to generate the options with a bit more manual effort.

@HeyJoel
Copy link
Member

HeyJoel commented Feb 24, 2022

Fixed, will be release in v0.10

@HeyJoel HeyJoel closed this as completed Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants