Copied to clipboard

Flag this post as spam?

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


  • R2-D2 11 posts 31 karma points
    Mar 14, 2012 @ 15:39
    R2-D2
    0

    Get all properties of a Tab

    I have a problem recovering the properties of a Tab called "Features".

    With this code:

        @foreach (var t in DynamicModel.Attributes)
        {   
            if(t.AttributeDefinition.AttributeGroup.Name == "Features")
            { string propName =  t.AttributeDefinition.Name;
            <h3>label: @propName</h3>        
            }
        }

    I get all the propertie's labels, but how i access to their values?

    Thanks for answering

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Mar 14, 2012 @ 16:04
    Dirk De Grave
    0

    I guess you're on v5? I think you need

    DynamicModel.Attributes[propName].DynamicValue

    to retrieve the values for each of the properties.

     

    Hope this helps.

    Cheers,

    /Dirk

  • R2-D2 11 posts 31 karma points
    Mar 14, 2012 @ 18:08
    R2-D2
    0

    Thanks a lot Dirk, That worked like a dream

       @foreach (var t in DynamicModel.Attributes)
        {   
            if (t.AttributeDefinition.AttributeGroup.Name == "Features")
            { string propName =  t.AttributeDefinition.Alias;
              <h3> Prop: @DynamicModel.Attributes[propName].DynamicValue</h3>     
            }
        }

    the problem was AttributeDefinition.Name instead of AttributeDefinition.Alias ;)

Please Sign in or register to post replies

Write your reply to:

Draft