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

14 posts, 0 answers
  1. Nikos
    Nikos avatar
    8 posts
    Member since:
    Dec 2011

    Posted 21 Dec 2011 Link to this post

    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
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 22 Dec 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Nikos
    Nikos avatar
    8 posts
    Member since:
    Dec 2011

    Posted 23 Dec 2011 Link to this post

    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


  5. Nick
    Nick avatar
    21 posts
    Member since:
    Sep 2007

    Posted 24 Dec 2011 Link to this post

    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.
  6. Nick
    Nick avatar
    21 posts
    Member since:
    Sep 2007

    Posted 26 Dec 2011 Link to this post

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

    chart.ResetTheme()

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


  7. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 28 Dec 2011 Link to this post

    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 >>

  8. K.G.
    K.G. avatar
    1 posts
    Member since:
    Sep 2010

    Posted 02 Jan 2012 Link to this post

    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

  9. Nick
    Nick avatar
    21 posts
    Member since:
    Sep 2007

    Posted 02 Jan 2012 Link to this post

    Sorry for not being clear. I was responding to the error. In my code error is gone when I resettheme method.
  10. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 03 Jan 2012 Link to this post

    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 >>

  11. Pabitra
    Pabitra avatar
    7 posts
    Member since:
    Jun 2012

    Posted 18 Jan 2012 Link to this post

    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
  12. Sia
    Admin
    Sia avatar
    667 posts

    Posted 23 Jan 2012 Link to this post

    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 >>

  13. Aaron
    Aaron avatar
    9 posts
    Member since:
    Mar 2011

    Posted 24 Jan 2012 Link to this post

    How do we fix this error if the Chart is bound to a ViewModel?
  14. Michael
    Michael avatar
    105 posts
    Member since:
    Nov 2010

    Posted 09 Feb 2012 Link to this post

    Ditto: how to resolve with a viewmodel?
  15. Sia
    Admin
    Sia avatar
    667 posts

    Posted 13 Feb 2012 Link to this post

    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 >>
Back to Top
UI for WPF is Visual Studio 2017 Ready