This is a migrated thread and some comments may be shown as answers.

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

13 Answers 116 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Nikos
Top achievements
Rank 1
Nikos asked on 21 Dec 2011, 04:46 PM
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

13 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 22 Dec 2011, 02:44 PM
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 >>

0
Nikos
Top achievements
Rank 1
answered on 23 Dec 2011, 09:50 AM
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


0
Nick
Top achievements
Rank 1
answered on 25 Dec 2011, 12:09 AM
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.
0
Nick
Top achievements
Rank 1
answered on 26 Dec 2011, 06:17 PM
Found it..just add ResetTheme before adding chart series..

chart.ResetTheme()

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


0
Giuseppe
Telerik team
answered on 28 Dec 2011, 01:33 PM
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 >>

0
K.G.
Top achievements
Rank 1
answered on 02 Jan 2012, 10:08 AM
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

0
Nick
Top achievements
Rank 1
answered on 02 Jan 2012, 10:29 PM
Sorry for not being clear. I was responding to the error. In my code error is gone when I resettheme method.
0
Giuseppe
Telerik team
answered on 03 Jan 2012, 02:21 PM
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 >>

0
Pabitra
Top achievements
Rank 1
answered on 18 Jan 2012, 09:20 PM
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
0
Sia
Telerik team
answered on 23 Jan 2012, 10:44 AM
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 >>

0
Aaron
Top achievements
Rank 1
answered on 24 Jan 2012, 11:58 PM
How do we fix this error if the Chart is bound to a ViewModel?
0
Michael
Top achievements
Rank 1
answered on 09 Feb 2012, 01:16 PM
Ditto: how to resolve with a viewmodel?
0
Sia
Telerik team
answered on 13 Feb 2012, 05:51 PM
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 >>
Tags
Chart
Asked by
Nikos
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Nikos
Top achievements
Rank 1
Nick
Top achievements
Rank 1
K.G.
Top achievements
Rank 1
Pabitra
Top achievements
Rank 1
Sia
Telerik team
Aaron
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Share this question
or