﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Enhancement Requests  » Enum Replacement Character</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 08:52:51 GMT</lastBuildDate><ttl>20</ttl><item><title>Enum Replacement Character</title><link>http://forum.strataframe.net/FindPost5780.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;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:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Enum&lt;/SPAN&gt;&lt;FONT color=#000000&gt; UserType&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;HRA_Employee &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;HSA_Employee &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Other_County_Employee &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Community_Partner &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Contractor &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Vendor &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;End&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Enum&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 8pt; COLOR: #1f5080"&gt;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.&lt;/SPAN&gt;</description><pubDate>Sat, 20 Jan 2007 09:51:06 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: Enum Replacement Character</title><link>http://forum.strataframe.net/FindPost5995.aspx</link><description>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.</description><pubDate>Sat, 20 Jan 2007 09:51:06 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Enum Replacement Character</title><link>http://forum.strataframe.net/FindPost5993.aspx</link><description>Hi,&lt;br&gt;
How could I preserve the order of my enum list (may be by its value instead of alphabetic order)?&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Sat, 20 Jan 2007 09:47:41 GMT</pubDate><dc:creator>Chan</dc:creator></item><item><title>RE: Enum Replacement Character</title><link>http://forum.strataframe.net/FindPost5973.aspx</link><description>Not right now.&amp;nbsp; You could, however, accomplish this by creating your own EnumTextBox subclass and within the constructor, add a handler to the this.DataBindings.CollectionChanged event.&amp;nbsp; Within this event, add a handler to the binding object's Format event.&amp;nbsp; Within the format handler, call the MicroFour.StrataFrame.Tools.Common.GetEnumDisplayValue() method and change the event args.&amp;nbsp; This will allow you to format the data going to the control.&lt;/P&gt;&lt;P&gt;If you want to allow the text box to be editable, then you'll also need to handle the Parse event of the binding object to reverse the process of the format event handler.</description><pubDate>Fri, 19 Jan 2007 15:13:48 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Enum Replacement Character</title><link>http://forum.strataframe.net/FindPost5970.aspx</link><description>Any plans on adding this capability to the situation where an enum is bound to a text box control? Right now the "unformatted" enum is displayed. &lt;/P&gt;&lt;P&gt;-Larry</description><pubDate>Fri, 19 Jan 2007 15:01:50 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: Enum Replacement Character</title><link>http://forum.strataframe.net/FindPost5835.aspx</link><description>...&lt;/P&gt;&lt;P&gt;:P</description><pubDate>Mon, 15 Jan 2007 12:04:28 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Enum Replacement Character</title><link>http://forum.strataframe.net/FindPost5824.aspx</link><description>[quote]It is documented yet?[/quote]&lt;/P&gt;&lt;P&gt;Kinda - it is in the "What's New in Version 1.5" .&amp;nbsp; I guess it was not enough of a hint.&amp;nbsp; We added the feature in order to localize enums -- those darn Brazilians.&amp;nbsp; :D&lt;/P&gt;&lt;P&gt;[quote]I assume this is available in 1.5.1? [/quote]&lt;/P&gt;&lt;P&gt;Good assumption.</description><pubDate>Mon, 15 Jan 2007 10:49:19 GMT</pubDate><dc:creator>Steve L. Taylor</dc:creator></item><item><title>RE: Enum Replacement Character</title><link>http://forum.strataframe.net/FindPost5806.aspx</link><description>This is why I try to read every forum post....you never know what amazing little tidbit you'll find. This is very cool.  It is documented yet? I assume this is available in 1.5.1?</description><pubDate>Sun, 14 Jan 2007 16:06:35 GMT</pubDate><dc:creator>Greg McGuffey</dc:creator></item><item><title>RE: Enum Replacement Character</title><link>http://forum.strataframe.net/FindPost5784.aspx</link><description>Very cool :cool: Somehow I missed that one. Thanks!</description><pubDate>Fri, 12 Jan 2007 13:32:55 GMT</pubDate><dc:creator>Larry Caylor</dc:creator></item><item><title>RE: Enum Replacement Character</title><link>http://forum.strataframe.net/FindPost5781.aspx</link><description>You can use the new EnumDisplayValueAttribute that we added just for this reason.&amp;nbsp; You just put the attributes on your enum values and when you build a combo box from the enum, you can just leave the EnumSeparatePascalCase values as their defaults and the enum's display values will be replaced with whatever you put in the string.&lt;/P&gt;&lt;P&gt;Public Enum MyEnum&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MicroFour.StrataFrame.Tools.EnumDisplayValue("My Value #1")&amp;gt; _&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyValue1&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;MicroFour.StrataFrame.Tools.EnumDisplayValue("My Value #2")&amp;gt; _&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyValue2&lt;BR&gt;End Enum&lt;/P&gt;&lt;P&gt;And since you're a C# guy (I think :))&lt;/P&gt;&lt;P&gt;public enum MyEnum&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [MicroFour.StrataFrame.Tools.EnumDisplayValue("My Value #1")]&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyValue1&lt;BR&gt;}&lt;/P&gt;&lt;P&gt;You can also pass a second value to the attribute constructor that tells it that the first value is a localization key rather than a literal string for replacement.&amp;nbsp;</description><pubDate>Fri, 12 Jan 2007 11:35:12 GMT</pubDate><dc:creator>Steve L. Taylor</dc:creator></item></channel></rss>