Selection not persisting

1 posts, 0 answers
  1. C
    C avatar
    43 posts
    Member since:
    Jul 2013

    Posted 16 Jan 2014 Link to this post

    I have a RadComboBox that gets its data set in the FrameWorkInitialize method like this:

     if (!IsPostBack)
                    string firstFilterName = adaptationFilters[0].FilterCategoryName;
                    var firstFilterGroup = adaptationFilters[0].FilterCategoryChoices.Select(afc => new ComboBoxItem(firstFilterName, afc)).ToList();
                    firstFilterGroup.Insert(0, new ComboBoxItem(firstFilterName, firstFilterName));
                    _filterDropDown1.DataSource = firstFilterGroup;
                    _filterDropDown1.SelectedIndex = 0;

    (where ComboBoxItem is an internal class that has an object, value and a string, text)

    Everything looks good until I pick a value. Well, the SelectedIndexChanged event also fires like it should, but after the postback, item 0 is selected again. This happen both with ViewStateMode enabled and without.

    What am I doing wrong?
Back to Top