Theming: Required resource not found, when assigning ItemsSource to RadChart

2 posts, 0 answers
  1. Ralph
    Ralph avatar
    8 posts
    Member since:
    Mar 2011

    Posted 11 May 2012 Link to this post

    I get the exception, "Telerik.Windows.Controls.Charting.ChartException", when attempting to assign the ItemsSource in the Completed delegate, ClientOnGetCardHighRiskTotalsCompleted below, used for getting the data.
    using System.Collections.ObjectModel;
    using System.Windows;
    using MyCompany.MySystem.Client.MySystemClient;
    using Telerik.Windows.Controls.Charting;
      
      
    namespace MyCompany.MySystem.UI.Controls.CardCharts
    {
        public partial class MainPage
        {
            private const string HIGH = "High";
            private const string VERYHIGH = "Very High";
            private const string SERIES1 = "Series1";
            private const string SERIES2 = "Series2";
            private App application;
            private ObservableCollection<CardRiskData> _seriesData;
            private MySystemServiceClient Client;
            public ObservableCollection<CardRiskData> SeriesData
            {
                get { return _seriesData; }
                set
                {
                    _seriesData = value;
                }
            }
      
            public MainPage()
            {
                InitializeComponent();
                application = (App)Application.Current;
      
                Client = new MySystemServiceClient("BasicHttpBinding_MySystemService", application.AppConfiguration["clientMySystemserviceurl"]);
      
                InitializeChartAreaSettings();
      
                Client.GetCardHighRiskTotalsCompleted += ClientOnGetCardHighRiskTotalsCompleted;
                string regionType = "BusinessRegion"
                string region = "";
                string location = "";
                Client.GetCardHighRiskTotalsAsync(regionType, region, location);
            }
      
            private void InitializeChartAreaSettings()
            {
                CardRiskChart.UseDefaultLayout = true;
                CardRiskChart.DefaultView.ResetTheme();
      
                CardRiskChart.DefaultView.ChartArea.AxisX.AxisStyles.AxisLineStyle =
                    LayoutRoot.Resources["CustomAxisLineStyle"] as Style;
                CardRiskChart.DefaultView.ChartArea.AxisX.AxisStyles.ItemLabelStyle =
                    LayoutRoot.Resources["SpaceSavingXLabelsStyle"] as Style;
                CardRiskChart.DefaultView.ChartArea.AxisY.AxisStyles.AxisLineStyle =
                    LayoutRoot.Resources["CustomAxisLineStyle"] as Style;
                CardRiskChart.DefaultView.ChartArea.AxisY.AxisStyles.ItemLabelStyle =
                    LayoutRoot.Resources["CustomItemLabelStyle"] as Style;
            }
      
            private void ClientOnGetCardHighRiskTotalsCompleted(object sender, GetCardHighRiskTotalsCompletedEventArgs e)
            {
                SeriesData = e.Result;
      
                ShowBarChart("Asset", HIGH, VERYHIGH);
                if (e.Error == null)
                {
                    CardRiskChart.ItemsSource = SeriesData;
                }
            }
      
            private void MapPresentationToBarChart(string strXValue, string yValue, int distance, string series)
            {
                if (!string.IsNullOrEmpty(yValue))
                {
                    var mapping = new SeriesMapping();
                    mapping.ItemMappings.Add(new ItemMapping
                    {
                        AggregateFunction = ChartAggregateFunction.None,
                        DataPointMember = DataPointMember.XCategory,
                        FieldName = strXValue
                    });
                    mapping.ItemMappings.Add(new ItemMapping(series, DataPointMember.YValue, ChartAggregateFunction.None));
                    var barSeriesDefinition = new BarSeriesDefinition
                    {
                        LabelSettings = { LabelDisplayMode = LabelDisplayMode.Outside, Distance = distance }
                    };
                    mapping.SeriesDefinition = barSeriesDefinition;
                    mapping.LegendLabel = yValue;
                    CardRiskChart.SeriesMappings.Add(mapping);
                }
            }
      
            public void ShowBarChart(string strXValue, string y1, string y2)
            {
                const int distance = 15;
      
                CardRiskChart.ItemsSource = null;
                CardRiskChart.SeriesMappings.Clear();
      
                //High
                MapPresentationToBarChart(strXValue, y1, distance, SERIES1);
                //Very High
                MapPresentationToBarChart(strXValue, y2, distance, SERIES2);
      
            }
              
             }
    }


    Here is the stack trace etc.
    ---------------------------------
    Telerik.Windows.Controls.Charting.ChartException was unhandled by user code
      Message=Theming: Required resource not found. Please, make sure you referenced all necessary themes and resources.
      StackTrace:
           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 Telerik.Windows.Controls.Charting.StaticConverter`2.Convert(Object value, Object parameter, CultureInfo culture)
           at Telerik.Windows.Controls.Charting.StaticConverter`2.Convert(Object value, Object parameter)
           at Telerik.Windows.Controls.Charting.ChartLegend.CalculateLegendItemStyle(ChartLegendItem item)
           at Telerik.Windows.Controls.Charting.ChartLegend.CreateLegendItem(DataSeries series, Int32 index)
           at Telerik.Windows.Controls.Charting.ChartLegend.<CreateSeriesLegendItems>d__3.MoveNext()
           at Telerik.Windows.Data.RadObservableCollection`1.AddRange(IEnumerable`1 items)
           at Telerik.Windows.Controls.Charting.ChartLegend.CreateLegendItems(ChartArea chartArea)
           at Telerik.Windows.Controls.Charting.ChartLegend.UpdateLegendItems(ChartArea chartArea)
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateLegend()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesItemPropertyChanged(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.OnItemPropertyChanged(Object sender, PropertyChangedEventArgs args)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(PropertyChangedEventArgs e)
           at Telerik.Windows.Controls.Charting.BaseFormattableData.OnPropertyChanged(String propertyName)
           at Telerik.Windows.Controls.Charting.DataPoint.set_XValue(Double value)
           at Telerik.Windows.Controls.Charting.ReadOnlyDataSeriesCollection.ProcessCategories()
           at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
           at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesCollectionChanged(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 Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.AddRange(IEnumerable`1 items)
           at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ChartArea chartArea)
           at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData)
           at Telerik.Windows.Controls.RadChart.Rebind(Object originalData)
           at Telerik.Windows.Controls.RadChart.ItemsSourcePropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs args)
           at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
           at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
           at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
           at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
           at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
           at Telerik.Windows.Controls.RadChart.set_ItemsSource(Object value)
           at MyCompany.MySystem.UI.Controls.CardCharts.MainPage.ClientOnGetCardHighRiskTotalsCompleted(Object sender, GetCardHighRiskTotalsCompletedEventArgs e)
           at MyCompany.MySystem.Client.MySystemClient.MySystemServiceClient.OnGetCardHighRiskTotalsCompleted(Object state)
      InnerException:

    ---------------------------------
    This error has me puzzelled. I have tried making sure Chart settings are set in InitializeChartAreaSettings, and comparing this to a chart which does work in my system. I have attached snapshots of the ItemSource and Chart control's setting in debug. Please let me know what other information you may need. The error message does not make any sense to me.
  2. Ralph
    Ralph avatar
    8 posts
    Member since:
    Mar 2011

    Posted 11 May 2012 Link to this post

    I found out that apparently I needed to reference the Themes.Vista assembly. I neglected to mentioned that my XAML included the following
    <Grid x:Name="LayoutRoot" Background="White">
            <Grid.Resources>
                <Style x:Key="CustomAxisLineStyle" TargetType="Line">
                    <Setter Property="Stroke" Value="White" />
                </Style>
      
                <Style x:Key="CustomItemLabelStyle" TargetType="TextBlock">
                    <Setter Property="Foreground" Value="White" />
                </Style>
                <Style x:Key="SpaceSavingXLabelsStyle" TargetType="TextBlock">
                    <Setter Property="Foreground" Value="White" />
                    <Setter Property="TextWrapping" Value="Wrap"/>
                </Style>
            </Grid.Resources>
            <chart:RadChart Name="CardRiskChart" HorizontalAlignment="Left" telerik:StyleManager.Theme="Vista" />            
        </Grid>
     With the information in the link RadControls for Silverlight - Theming I was able to eventually find the Theming assemblies and include the right one.
  3. DevCraft banner
Back to Top