I am trying to dynamically change the theme of a RadChart. I have a combobox control that has the various Themes available. When the user selects on I pass the SelectedIndex into this method.
public
void ChangeTheme(int index)
{
try
{
switch (index)
{
case 0:
StyleManager.SetTheme(chart, new Office_BlackTheme());
break;
case 1:
StyleManager.SetTheme(chart, new Office_BlueTheme());
break;
case 2:
StyleManager.SetTheme(chart, new Office_SilverTheme());
break;
case 3:
StyleManager.SetTheme(chart, new SummerTheme());
break;
case 4:
StyleManager.SetTheme(chart, new VistaTheme());
break;
default:
StyleManager.SetTheme(chart, new Office_BlackTheme());
break;
}
}
catch (Exception err)
{
string msg = err.Message;
}
}
On the initial load I don’t have any problems and the chart comes up with its Black theme color settings. However once I try and change the Theme there is an application level exception throw, “Value does not fall within the expected range.” I am unsure what I am doing wrong. I am following the sample provided in the documentation. Any assistance would be greatly appreciated.
Thanks ahead of time
MacKenzie