Copied to clipboard

Flag this post as spam?

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


  • overflew 87 posts 110 karma points
    Jun 23, 2010 @ 03:01
    overflew
    0

    Get available Pre values for an extended Dropdown

    Hi,

    Just wondering how I'd do about getting all available Pre values for a given Dropdown, in .NET?

    I'm doing a large batch of data migration, and would like to fish out the available values (for a given datatype), so I can map them appropriately on the new Umbraco documents. (So that document.getProperty(propertyName).Value = value will pan out)

    For instance, I have a Data Type 'Region', using 'drop down list' picker, which has the values:

    • [12] - Australia
    • [13] - Pacific

    The values behind may change across staging environments, so I'd like to retrieve them in the code programmatically.

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Jun 23, 2010 @ 07:58
    Stefan Kip
    0

    Use this:

    int

     

    dataType = <your_datatype_id>;

    System.Xml.XPath.

    XPathNodeIterator iterator = umbraco.library.GetPreValues(dataType);

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Jun 23, 2010 @ 07:59
    Stefan Kip
    0

    Hmm, that shows ugly, second try:

     

    int

     

    dataType = <your_datatype_id>;
    System.Xml.XPath.
    XPathNodeIterator iterator = umbraco.library.GetPreValues(dataType);

  • 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