Copied to clipboard

Flag this post as spam?

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

  • John Hodgkinson 613 posts 355 karma points
    Feb 10, 2017 @ 13:05
    John Hodgkinson

    Access DataType values from partial view

    I'm sure this is a simple question but was not able to find anything on initial searching. How can I access the data values from a partial view?

    When Umbraco native data types I could do something like:

    // Get data type id
    var dataTypeId = 1234;
    var preValues = PreValues.GetPreValues(dataTypeId).Values;
    var enumerator = preValues.GetEnumerator();
    <div class="datatype-items">    
        @while (enumerator.MoveNext())
            // Get List Item Value  
            var category = ((umbraco.cms.businesslogic.datatype.PreValue)enumerator.Current).Value;
            // Output item name 

    Many thanks in advance!

  • Alex Skrypnyk 6112 posts 23606 karma points MVP 7x admin c-trib
    Feb 11, 2017 @ 23:45
    Alex Skrypnyk

    Hi John

    Do you want to get data of some Umbraco node?

    Datatypes don't store values of data, this is only type of possible data in Umbraco node

    How to get data from nodes read here -



  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Feb 21, 2017 @ 21:27
    Hendy Racher

    Hi John,

    There's a strongly typed Picker object that returns the picked items, but unfortunately it doesn't have a property to return the source collection (issue on github)

Please Sign in or register to post replies

Write your reply to: