Copied to clipboard

Flag this post as spam?

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


  • Tom Maton 387 posts 660 karma points
    Jul 26, 2012 @ 23:30
    Tom Maton
    0

    Get all dictionary items in c#

    Hi All,

    I looking for a way to retrieve all my dictionary items from a locale.

    I've got my dictionary items setup like so:

    dictionary
    -- section 1
      -- dictionary 1
      -- dictionary 2
      -- dictionary 3
    -- section 2
      -- dictionary 1
      -- dictionary 2
    -- section 1
      -- dictionary 1
      -- dictionary 2
      -- dictionary 3
      -- dictionary 4
      -- dictionary 5

    I know I can use GetDictionaryItems("section 1") and that will retrieve me all the items under section 1 but I want to get everything under the dictionary. Does anyone have any idea on how I can achieve this?

    Thanks,

    Tom

  • jivan thapa 194 posts 681 karma points
    Jul 27, 2012 @ 10:49
    jivan thapa
    1

    try:

    foreach (cms.businesslogic.Dictionary.DictionaryItem d in cms.businesslogic.Dictionary.getTopMostItems)
                {              
                    if(d.hasChildren)
                    {
                        foreach(cms.businesslogic.Dictionary.DictionaryItem d1 in d.Children)
                        {
                            Response.Write(d1.Value(1) + "< br/>");                      
                        }
                    }
                }

    where 1 in "value( )" means languageId.

  • Tom Maton 387 posts 660 karma points
    Jul 27, 2012 @ 14:02
    Tom Maton
    0

    Cheers, I'll give that a go.

    Tom

  • jivan thapa 194 posts 681 karma points
    Jul 28, 2012 @ 02:02
    jivan thapa
    0

    Hi , Tom.

    Remember to mark as "solved" if your problem is solved.

     

Please Sign in or register to post replies

Write your reply to:

Draft