Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    Jan 05, 2012 @ 09:54
    Anthony Candaele
    0

    where to find the ID of a datatype

    Hi,

    for my registerMember.ascx user control I need to load the prevalues of a checkboxlist datatype. For this use the Umbraco library method:

    umbraco.library.GetPreValues(1097)


    the problem I have is that I don't find the id of this datatype. The only thing that I see is the GUID of the datatype:

    Could it be that this has changed from Umbraco 4.5.1 over Umbraco 4.7.1 ? Or am I overlooking something?

    Thanks for your help,

    Anthony

  • Jeroen Breuer 4909 posts 12266 karma points MVP 6x admin c-trib
    Jan 05, 2012 @ 10:08
    Jeroen Breuer
    2

    If you're using chrome and you hover the node in the tree you can see the id on the bottom left :). You can also look at the umbracoNode table in the database to find het id.

    Jeroen

  • Mike Chambers 636 posts 1253 karma points c-trib
    Jan 05, 2012 @ 10:09
    Mike Chambers
    1

    Think if you roll over the datatype and look in the browser status bar the id is revealed, but rather than relying on finding the datatype id, you could look it up using the name

    A bit of linq may help... 

    something along the lines of

    ICollection values = PreValues.GetPreValues(DataTypeDefinition.GetAll().First(dtDef => dtDef.DataType.DataTypeName.ToString() == "Job Experience DataType").DataType.DataTypeDefinitionId).Values;

  • Anthony Candaele 1197 posts 2049 karma points
    Jan 05, 2012 @ 10:16
    Anthony Candaele
    0

    @ Jeroen, Thanks, this solves my problem
    @ Mike thanks your Linq solution solves the problem of using a hardcoded datatype id and I'll certainly give it a try. I'll let you know if it worked out.

    greetings,

    Anthony 

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies