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.DataBind();
_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?
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.DataBind();
_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?