Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peng 41 posts 62 karma points
    Sep 14, 2010 @ 10:49
    Peng
    0

    Cusom data type values were not stored as Integer

     

    Hi Guys,

     

    I created a custom data type with Render Control as dropdown list in umbraco 4.5.

    Eg :

    Database datatype - integer

    Text – New

    Value – 30

     

    After I created and published a page with the property set as “New” from dropdown list, it showed in database as below:

    <eventStatus><![CDATA[New]]></eventStatus>

     

    What I expected here is 30 so that I can use enum type in c# code to check which one has been selected.

    I also tried to set the database datatype – Ntext and Nvarchar, but no luck and they stored the same value as above in database.

     

    Thanks in advance,

     

    Peng

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 14, 2010 @ 11:59
    Dirk De Grave
    0

    Must use a dropdown, publishing keys as render control to publish the value 30 rather than the text.

    Be aware tho that you don't get control over the id value as this is the id of the cmsDataTypePreValues table which has an autonumber key.

     

    Hope this helps.

    Regards,

    /Dirk

  • Peng 41 posts 62 karma points
    Sep 15, 2010 @ 02:15
    Peng
    0

    Thanks Dirk!

    Its working now.

    Regards,

    Peng

     

     

     

     

Please Sign in or register to post replies

Write your reply to:

Draft