Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Chart > RadChart "Theming resource not found" in 2011 Q3 with SP1

Not answered RadChart "Theming resource not found" in 2011 Q3 with SP1

Feed from this thread
  • Nikos avatar

    Posted on Dec 21, 2011 (permalink)

    Greetings,
     
    I keep getting the "theming resource not found" exception when trying to clear the current data series of a chart component, even though i patched up the Q3 2011 version with SP1. The code that throws the exception is the following:

    Private Sub ResetDataSeries()
     Dim seriesCollection As DataSeriesCollection = chart.DefaultView.ChartArea.DataSeries
     seriesCollection.SuspendNotifications()
           
     For Each series In seriesCollection
      series.SuspendNotifications()
      series.Clear()
      series.ResumeNotifications()
     Next
     
     seriesCollection.Clear()
     seriesCollection.ResumeNotifications()
     _DataPoints.Clear()
    End Sub

    and the stack-trace is as follows: 

    Theming: Required resource not found. Please, make sure you referenced all necessary themes and resources.
    (Telerik.Windows.Controls.Charting.ChartException, Telerik.Windows.Controls.Charting)
           at Telerik.Windows.Controls.Charting.BaseSeriesConverter`1.GetThemeStyle(Object chartItem, Object parameter)
           at Telerik.Windows.Controls.Charting.BaseSeriesConverter`1.Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
           at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
           at System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange)
           at MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange)
           at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
           at MS.Internal.Data.PropertyPathWorker.RefreshValue()
           at MS.Internal.Data.ClrBindingWorker.RefreshValue()
           at System.Windows.Data.BindingExpression.UpdateTarget()
           at System.Windows.Data.BindingExpressionBase.InvalidateCulture()
           at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
           at System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
           at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
           at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
           at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
           at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
           at System.Windows.TreeWalkHelper.InvalidateTreeDependentProperty(TreeChangeInfo info, DependencyObject d, FrameworkObject& fo, DependencyProperty dp, FrameworkPropertyMetadata fMetadata, Style selfStyle, Style selfThemeStyle, ChildRecord& childRecord, Boolean isChildRecordValid, Boolean hasStyleChanged, Boolean isSelfInheritanceParent)
           at System.Windows.TreeWalkHelper.InvalidateTreeDependentProperties(TreeChangeInfo info, FrameworkElement fe, FrameworkContentElement fce, Style selfStyle, Style selfThemeStyle, ChildRecord& childRecord, Boolean isChildRecordValid, Boolean hasStyleChanged, Boolean isSelfInheritanceParent)
           at System.Windows.FrameworkElement.InvalidateTreeDependentProperties(TreeChangeInfo parentTreeState, Boolean isSelfInheritanceParent)
           at System.Windows.FrameworkElement.OnAncestorChangedInternal(TreeChangeInfo parentTreeState)
           at System.Windows.TreeWalkHelper.OnAncestorChanged(DependencyObject d, TreeChangeInfo info)
           at System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
           at MS.Internal.PrePostDescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
           at System.Windows.TreeWalkHelper.InvalidateOnTreeChange(FrameworkElement fe, FrameworkContentElement fce, DependencyObject parent, Boolean isAddOperation)
           at System.Windows.FrameworkElement.OnVisualParentChanged(DependencyObject oldParent)
           at System.Windows.Media.Visual.FireOnVisualParentChanged(DependencyObject oldParent)
           at System.Windows.Media.Visual.RemoveVisualChild(Visual child)
           at System.Windows.Media.VisualCollection.DisconnectChild(Int32 index)
           at System.Windows.Media.VisualCollection.Clear()
           at System.Windows.Controls.UIElementCollection.ClearInternal()
           at System.Windows.Controls.Panel.ClearChildren()
           at System.Windows.Controls.Panel.OnItemsChangedInternal(Object sender, ItemsChangedEventArgs args)
           at System.Windows.Controls.Panel.OnItemsChanged(Object sender, ItemsChangedEventArgs args)
           at System.Windows.Controls.ItemContainerGenerator.OnRefresh()
           at System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
           at System.Windows.Controls.ItemContainerGenerator.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
           at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
           at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
           at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
           at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
           at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
           at System.Windows.Controls.ItemCollection.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)
           at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
           at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
           at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
           at System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
           at System.Windows.Data.ListCollectionView.RefreshOverride()
           at System.Windows.Data.CollectionView.RefreshOrDefer()
           at System.Windows.Data.ListCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
           at System.Windows.Data.CollectionView.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
           at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
           at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
           at Telerik.Windows.Data.RadObservableCollection`1.ResumeNotifications()
           at Entersoft.Framework.Dashboard.Controls.Chart.ResetDataSeries() in D:\build\ESDev40\Framework\ESSessionServer\ESDashboard\ESDashboard.Controls\Controls\Chart.xaml.vb:line 163
           at Entersoft.Framework.Dashboard.Controls.Chart.OnDataSourceChanged() in D:\build\ESDev40\Framework\ESSessionServer\ESDashboard\ESDashboard.Controls\Controls\Chart.xaml.vb:line 658
           at Entersoft.Framework.Dashboard.Controls.Chart.set_DataSource(IEnumerable value) in D:\build\ESDev40\Framework\ESSessionServer\ESDashboard\ESDashboard.Controls\Controls\Chart.xaml.vb:line 77
           at Entersoft.Framework.Dashboard.Presentation.Xaml.XamlChartItem.PerformRefreshDataCore() in D:\build\ESDev40\Framework\ESSessionServer\ESDashboard\ESDashboard.Controls\Presentation\DashboardItems\XamlChartItem.vb:line 192

    Any ideas?

    Nikos

    Reply

  • Giuseppe Giuseppe admin's avatar

    Posted on Dec 22, 2011 (permalink)

    Hello Nikos,

    We were unable to reproduce the problematic behavior when clearing in our local tests -- could you elaborate a bit on the specific scenario that you have on your end? We have attached our test application here as well.

    Looking forward to your reply.


    Kind regards,
    Giuseppe
    the Telerik team

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

    Attached files

    Reply

  • Nikos avatar

    Posted on Dec 23, 2011 (permalink)

    Thank you very much for your fast reply Giuseppe,

    It is true that our scenario is (quite) a bit more complex. To begin with, we have a WPF dashboard system that operates within a windows forms WPF host. Our typical usage scenario of the chart component includes a combination of one X-axis along with multiple Y-axes, plus the presence of the chart legend. Finally, the chart's data source is a collection of custom objects that operate as wrappers for the System.Data.DataRow object type. The problem occurs when the chart's data is filtered by another dashboard item, i.e. "old" data gets removed and new ones must be inserted. Specifically, as mentioned in my original post, the theming exception occurs at the process of clearing the "old" data.

    I will try to create a test project that will reproduce the error, and attach it here for your disposal. However, it is not certain if such a thing is possible outside the scope of our application. Unfortunately, we have faced this "non reproducability" (if we could use such a term) issue before with the RadGridView, with which we faced a notorious bug on column re-sizing, until we upgraded to the 2011 Q3 version (our last used version was Q3 of 2010).

    Yours sincerely,
    Nikos Nakas
    Entersoft SA Development Department


    Reply

  • Nick avatar

    Posted on Dec 24, 2011 (permalink)

    I get same error too.its basically I am getting for chart drill down. Please email me cacompguy@gmail.com so that i can send you the code.

    Reply

  • Nick avatar

    Posted on Dec 26, 2011 (permalink)

    Found it..just add ResetTheme before adding chart series..

    chart.ResetTheme()

    chart.DefaultView.ChartArea.DataSeries.Add(series)


    Reply

  • Giuseppe Giuseppe admin's avatar

    Posted on Dec 28, 2011 (permalink)

    Hello Nick,

    Unfortunately we are still unable to reproduce the problem in this scenario even after adding the ResetTheme() call -- please review the attached sample application and let us know if we are missing something out (note that it is imperative for an unbound chart to perform the configuration in the RadChart.Loaded handler or later).


    All the best,
    Giuseppe
    the Telerik team

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

    Reply

  • K.G. avatar

    Posted on Jan 2, 2012 (permalink)

    Hi

    I get the same error as mentioned here.
    I get this error when i am displaying the Legend for the radchart
    In my code the chart is created dynamically at runtime using c#, even the toggle to display the legend or not happens at runtime

    If i make the Legend InVisible it works without error

    Any help on the same would be appreciated

    we are using version q3 2011 sp1 with hotfix from Telerik, We have recently purchased telerik components for silverlight with support
    Request the Telerik Team to reply ASAP as we have to take our code to production

    Thanks in advance

    Reply

  • Nick avatar

    Posted on Jan 2, 2012 (permalink)

    Sorry for not being clear. I was responding to the error. In my code error is gone when I resettheme method.

    Reply

  • Giuseppe Giuseppe admin's avatar

    Posted on Jan 3, 2012 (permalink)

    Hello K.G. Subramanian,

    For an unbound chart that is created in code-behind you need to make sure that you are performing the configuration logic in the RadChart.Loaded handler like this:
    public MainWindow()
    {
        InitializeComponent();
     
        RadChart chart = new RadChart();
        chart.Loaded += (sender, args) =>
            {
                DataSeries series = new DataSeries();
                series.Add(new DataPoint(20));
                series.Add(new DataPoint(30));
                series.Add(new DataPoint(40));
                series.Add(new DataPoint(50));
     
                chart.DefaultView.ChartArea.DataSeries.Add(series);
     
                chart.DefaultView.ChartLegend.UseAutoGeneratedItems = false;
                chart.DefaultView.ChartLegend.Items.Add(new ChartLegendItem() { Label = "Test 1" });
                chart.DefaultView.ChartLegend.Items.Add(new ChartLegendItem() { Label = "Test 2" });
                chart.DefaultView.ChartLegend.Items.Add(new ChartLegendItem() { Label = "Test 3" });
            };
     
        this.LayoutRoot.Children.Add(chart);
    }



    All the best,
    Giuseppe
    the Telerik team

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

    Reply

  • Pabitra avatar

    Posted on Jan 18, 2012 (permalink)

    I am getting this "Theming:Required resource not found. Please, make sure you referenced all necessary themes and resources"

    I get this error when I am trying to create my own layout for the RadChart control in XAML. I have set the UseDefaultLayout = "False" for the chart control as I am providing my own layout using a Grid.

    Would really appreciate any help on getting rid of this error.

    Pabitra

    Reply

  • Sia Sia admin's avatar

    Posted on Jan 23, 2012 (permalink)

    Hi Pabitra,

    Please open a formal support thread and send us a small runnable project reproducing the experienced problem. Thus we will do our best to provide a solution. Thank you in advance for your cooperation.

    Regards,
    Sia
    the Telerik team

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

    Reply

  • Aaron avatar

    Posted on Jan 24, 2012 (permalink)

    How do we fix this error if the Chart is bound to a ViewModel?

    Reply

  • Michael Intermediate avatar

    Posted on Feb 9, 2012 (permalink)

    Ditto: how to resolve with a viewmodel?

    Reply

  • Sia Sia admin's avatar

    Posted on Feb 13, 2012 (permalink)

    Hello,

    Please review the provided solution in the other thread concerning the same issue. Having or not a view model is not important.

    You need to move the configuration code to the RadChart.Loaded event handler.

    All the best,
    Sia
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Chart > RadChart "Theming resource not found" in 2011 Q3 with SP1
Related resources for "RadChart "Theming resource not found" in 2011 Q3 with SP1"

WPF Chart Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]