Copied to clipboard

Flag this post as spam?

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


  • Thomas Elbek 5 posts 85 karma points
    Dec 18, 2014 @ 12:38
    Thomas Elbek
    0

    Umbraco 4.7 Custom Datatype

    I have created a custom datatype in Umbraco 4.7 that renders a dropdown List.

    In the Database datatype section I have added 2 text/value pairs, everything works fine when the datatype is then used on a document type.

    Now, I have the need for get hold of the text/value pairs for this datatype in C# code. Until now I have tried the following C# code:

    var meetingDatatype = umbraco.cms.businesslogic.datatype.DataTypeDefinition.GetAll().FirstOrDefault(r => r.Text == "MeetingType");

    It returns some kind of object, but how do I get the text/value pairs from the meetingDatatype object?

    Thanks in advance for any hints :-)

    Thomas (not an Umbraco shark, but slowly improving...)

  • Thomas Elbek 5 posts 85 karma points
    Dec 18, 2014 @ 13:39
    Thomas Elbek
    100

    Ahhhh - I found it...

    ((KeyValuePrevalueEditor)meetingDatatype.DataType.PrevalueEditor).Prevalues
Please Sign in or register to post replies

Write your reply to:

Draft