CodeSmith Community
Your Code. Your Way. Faster!

Is it possible to use an Enum as DataSource ?

Latest post 08-29-2008 10:41 AM by heckubus. 1 replies.
  • 01-10-2008 3:24 PM

    • velum
    • Top 25 Contributor
    • Joined on 07-14-2006
    • Montréal, Qc, Canada
    • Posts 186
    • Points 4,716

    Is it possible to use an Enum as DataSource ?

    Hi!

    I would like to know what is the simplest and best way to use an Enum as a DataSource. For example, if I have a table that I specify as being an EnumTable when generating the code, and that I have a DropDownList that I would like to populate with that Enum; is there an easy way to do that. I would prefer to avoid accessing the database just to populate the DropDownList with a few entries. I don'tknow if this would be possible, would it would be nice to be able to use Enums from EnumTables as Read-Only DataSources.

    Cheers!

    JF 

    Filed under: ,
    • Post Points: 35
  • 08-29-2008 10:41 AM In reply to

    • heckubus
    • Top 75 Contributor
    • Joined on 06-27-2006
    • Posts 56
    • Points 1,175

    Re: Is it possible to use an Enum as DataSource ?

    I would create a custom method in your component class to convert the enum into entities.

    • Post Points: 5
Page 1 of 1 (2 items) | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems