Weird Exception while applying Custom Theme.

2 posts, 1 answers
  1. Ariel Ben Horesh
    Ariel Ben Horesh avatar
    22 posts
    Member since:
    Dec 2009

    Posted 01 Nov 2011 Link to this post

    Hi,
    I've added to my solution a custom theme based on the summer theme.
    It all works well with other controls, but when I render out a Chart control it throws an exception:

    {System.Windows.ApplicationUnhandledExceptionEventArgs}
        base {System.EventArgs}: {System.Windows.ApplicationUnhandledExceptionEventArgs}
        ExceptionObject: {MS.Internal.WrappedException:  [Line: 0 Position: 0] ---> System.Windows.Markup.XamlParseException:  [Line: 0 Position: 0] ---> System.InvalidOperationException: Operation is not valid due to the current state of the object.
       ב System.Windows.Duration.get_TimeSpan()
       ב Telerik.Windows.Controls.Charting.BaseChartItem2D.ConfigureLinearLabelAnimation(Storyboard storyboard)
       ב Telerik.Windows.Controls.Charting.BaseChartItem2D.ConfigureLabelAnimation(Boolean shouldApplyAnimation)
       ב Telerik.Windows.Controls.Charting.BaseChartItem2D.ShowLabel(Boolean shouldApplyAnimation)
       ב Telerik.Windows.Controls.Charting.BaseChartItem2D.ShowLabelWithAnimation()
       ב Telerik.Windows.Controls.Charting.BaseChartItem2D.OnApplyTemplate()
       ב Telerik.Windows.Controls.Charting.BasePointMarkChartItem.OnApplyTemplate()
       ב System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)

       ב MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
       ב MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
       ב MS.Internal.XcpImports.FrameworkElement_ApplyTemplate(FrameworkElement frameworkElement)
       ב System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.GetElementRoot(Boolean templatesAreGenerated)
       ב System.Windows.Controls.ItemContainerGenerator.LayoutStatesManager.Load()
       ב System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
       ב System.Windows.Controls.ItemsControl.AddVisualChild(Int32 containerIndex, DependencyObject container, Boolean needPrepareContainer)
       ב System.Windows.Controls.ItemsControl.AddContainers()
       ב System.Windows.Controls.ItemsControl.RecreateVisualChildren(IntPtr unmanagedObj)

        Handled: false

    Any ideas ? 
    Thanks 
    Ariel
  2. Answer
    Sia
    Admin
    Sia avatar
    755 posts

    Posted 03 Nov 2011 Link to this post

    Hello Ariel Ben Horesh,

    When you have a custom theme applied to RadChart, there is one step in addition which needs to be done with the chart xaml. More information can be found in our help, and this help topic in particular. You need to add storyboards for your custom theme in the Chart.xaml file.

    Kind regards,
    Sia
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top