This is a migrated thread and some comments may be shown as answers.

How to Load items from a helper class?

0 Answers 62 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Aron
Top achievements
Rank 2
Aron asked on 03 Apr 2009, 09:50 AM
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;
    }


No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Aron
Top achievements
Rank 2
Share this question
or