Print Page | Close Window

Formatting an Ideablade "enum"

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=331
Printed Date: 28-May-2025 at 8:49pm


Topic: Formatting an Ideablade "enum"
Posted By: Dominique
Subject: Formatting an Ideablade "enum"
Date Posted: 26-Jul-2007 at 9:49am
Hi,
I am wondering how-to format a Text property of a generated enum when using it as a display member in a combo.
I tried to override both the property and ToString method but none worked. I also tried to find something around FormatString but could find a "firstLetterUpcase" :)
example:
I have a generated "enum" class like Status with Status.todo and Status.don), with the classicals Code and Text properties.
I using pm.getEntities(of Status) as a datasource to a combo and want to see:
Todo
Done
how could I achieve this?
Dominique




Replies:
Posted By: jeffdoolittle
Date Posted: 26-Jul-2007 at 12:53pm
Take a look at IdeaBlade.Util.StringFns

--Jeff


Posted By: Dominique
Date Posted: 26-Jul-2007 at 11:09pm
Originally posted by jeffdoolittle

Take a look at IdeaBlade.Util.StringFns

Hi,
Thank you for your answer, it was some nice functions there.
I might have asked the question wrongly, because my concern was more about where to put the code. :)
I.E. do I need to have a ProperCaseTekst property in every enum class. In this case I might go for an abstract formating class.
It would actually have been nice if, taking my example, a Status class was a superclass for the Status.done, Status.todo (done and todo _are_ status)
Dominique


Posted By: Dominique
Date Posted: 26-Jul-2007 at 11:30pm
Originally posted by Dominique


It would actually have been nice if, taking my example, a Status class was a superclass for the Status.done, Status.todo (done and todo _are_ status)

Oops,
shame on me, it works just like that. I won't even try to find a bad excuse :D.
Thanks Jeff for your pointer, it still some nice useful functions in there.
Dominique


Posted By: jeffdoolittle
Date Posted: 27-Jul-2007 at 12:12pm
No problem.  



Print Page | Close Window