How to Load items from a helper class?

1 posts, 0 answers
  1. Aron
    Aron avatar
    80 posts
    Member since:
    Dec 2005

    Posted 03 Apr 2009 Link to this post

    Hello, on the code behind of a page I am doing this:
    RadComboBoxTheme = ThemeHelper.LoadThemes(); // Load Themes
    After this line is executed, the RadComboBoxTheme has items, however they are not displayed on the list.
    Do I need to do anything else to make this work?

    public static RadComboBox LoadThemes()
        {
            RadComboBox box = new RadComboBox();
            // Load Themes
            ThemeCollection themeCol = new ThemeCollection().Load();
            themeCol.Sort(TS.Common.Objects.Theme.Columns.Title, true);

            RadComboBoxItem item;
            foreach (Theme theme in themeCol)
            {
                item = new RadComboBoxItem();
                item.ImageUrl = string.Format("../images/Theme/Small/{0}.jpg", theme.Title);
                item.Text = theme.Title;
                item.Value = theme.Id.ToString();
                box.Items.Add(item);
            }
            return box;
        }


Back to Top