Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7608267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:52:21+00:00 2026-05-31T00:52:21+00:00

I have enums in my domain like this public enum AdTypeEnum { Sale =

  • 0

I have enums in my domain like this

public enum AdTypeEnum { Sale = 1, Rent = 2, SaleOrRent = 3 };

In my view I’m rendering this enums like this

<div class="editor-field">
   @Html.DropDownListFor(x => x.AdType, new SelectList(Enum.GetValues(typeof(MyDomain.Domain.Property.AdTypeEnum))))
</div>

Now, what I’m trying to achive is based on selected language I want to display these enums in drop down list in selected language.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:52:22+00:00Added an answer on May 31, 2026 at 12:52 am

    Did you try something like:

    public static Array Localize(Array values)
    {
     string[] result = new string[values.Length];
     for (int i = 0; i < values.Length; ++i)
      result[i] = Resources.ResourceManager.GetString(values.GetValue(i).ToString());
    
     return result;
    }
    

    A better implementation should use a different key-set for each enum type (using the enum name as part of the GetString() parameter).
    Anyway this method is pretty naive, I think for a big application (or for more complex scenarios) you may need to inherit from SelectList class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have defined my Enums like this. public enum UserType { RESELLER(Reseller), SERVICE_MANAGER(Manager), HOST(Host);
Since Java 1.4 doesn't have enums I'm am doing something like this: public class
I have a ViewModel that looks like this: public class CreateReviewViewModel { public string
What I want to do is something like this: I have enums with combined
I have a field with enums: 'preview','active','closed' When I query like this: $query =
In AccountType.cs I have: namespace MooDB.Domain { public enum AccountType {Real, Demo, Fictional}; }
I have enums in one of my windows application like below: private enum ModificationType
I've got a grails domain class I have to persist in Redis, something like
I have multiple enums in my code: public enum First { a, b, c,
If I have enums like: enum EnumA { stuffA = 0 }; enum enumAA

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.