Hi,
I am trying to change the selected view on my scheduler via a SelectedIndexChanged event from a combo box. I do not want to give the user the ability to select all the views, so i have created a combo that only gives the options of timeline & month.
When the user selects the option that it is not the default, I get the following exception:
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
If I use the combobox to change other properties, such as the selected date etc, it works fine. It only throws the exception when I am trying to change the selected view.
Could you please tell me how I can get that working?
The controls are ajaxified using a rad ajax manager
I am trying to change the selected view on my scheduler via a SelectedIndexChanged event from a combo box. I do not want to give the user the ability to select all the views, so i have created a combo that only gives the options of timeline & month.
When the user selects the option that it is not the default, I get the following exception:
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
If I use the combobox to change other properties, such as the selected date etc, it works fine. It only throws the exception when I am trying to change the selected view.
Could you please tell me how I can get that working?
void SchedulerView_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) |
{ |
if (SchedulerView.SelectedValue == "Timeline") |
{ |
SiteSchedule.SelectedView = SchedulerViewType.TimelineView; |
} |
else if (SchedulerView.SelectedValue == "Month") |
{ |
SiteSchedule.SelectedView = SchedulerViewType.MonthView; |
} |
} |