Enum Replacement Character


Author
Message
Larry Caylor
Larry Caylor
StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)StrataFrame VIP (1.8K reputation)
Group: Awaiting Activation
Posts: 592, Visits: 3.7K

While the EnumSeparatePascalCase handles many situations it would be nice to be able to specify a substitution character like an underscore that could be used to insert spaces when displaying a enum. For example in our organization all departments are represented by a three character abbreviation and I have an enum that looks like:

 

Public Enum UserType

    HRA_Employee  

    HSA_Employee  

    Other_County_Employee  

    Community_Partner  

    Contractor  

    Vendor  

End Enum

 

Since I can’t separate all of them on PascalCase I end up inserting underscores. This works but it would make the application cleaner if I could easily eliminate the underscores when displaying the information.

Replies
Chan
Chan
Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)Advanced StrataFrame User (965 reputation)
Group: Forum Members
Posts: 533, Visits: 2K
Hi,

How could I preserve the order of my enum list (may be by its value instead of alphabetic order)?



Thank you
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
If you are loading the enum into a combo, then you can either turn off the Sorted property so it will be in natural order, or you can change the sort to go by the value rather than the text.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search