If you define a custom palette in RadChart and use the LoadFromXml() method, the control will throw an error in FillStyle.GetHashCode(). Basically, what I think is going on there is that the PalettesCollection.GetPalette() method is throwing an error because the "CustomPalettes" property has not yet loaded the custom palette that is defined declaratively in the control’s XML markup on the aspx page.
Relevant code in Telerik.Charting.PalettesCollection.PalettesCollection.cs:
public static Palette GetPalette(string name, Chart chart)
{
if (!chart.CustomPalettes.Contains(name))
{
throw new ChartException(string.Format("There is no Palette with name: {0}", name));
}
return chart.CustomPalettes.GetPalette(name);
}
Declarative definition sample in the aspx page:
<CustomPalettes>
<telerik:Palette Name="CustomPaletteColorful">
<Items>
<telerik:PaletteItem MainColor="0xff, 0xba, 0x4a" SecondColor="0xff, 0xf4, 0xe3">
</telerik:PaletteItem>
<telerik:PaletteItem MainColor="0x15, 0xc5, 0x16" SecondColor="0xda, 0xf6, 0xda">
</telerik:PaletteItem>
<telerik:PaletteItem MainColor="0xff, 0x5b, 0" SecondColor="0xff, 0xe5, 0xd7">
</telerik:PaletteItem>
</Items>
</telerik:Palette>
</CustomPalettes>