Intermittent NullReferenceExceptions on Chart Update

4 posts, 0 answers
  1. Jake
    Jake avatar
    7 posts
    Member since:
    Sep 2011

    Posted 03 Oct 2011 Link to this post

    Hello,

    We have a basic chart with five series mappings, three of which have visibility bound to checkboxes. The series visibility works as expected, save for occasionally throwing random null reference exceptions when we check/uncheck the box. This happens every so often on no observable schedule, but can be consistently produced when erratically checking and unchecking the checkbox.We have also implemented a zoom feature and have taken advantage of suspendNotification/resumeNotification for the ZoomScrollSettings.We have tried to suspend/resume with the DataSeries but we are still getting intermittent null reference exceptions. We originally thought that there was a race condition between the recalculation of the y-axis and the chart data mapping.

    When changing visibility of series mappings, to which property should we spend notifications?  or are there any other ideas why this might be occurring?

    Code for reference:
    // one of the series mappings
    <telerik:LineSeriesDefinition ShowItemLabels="False" ShowPointMarks="False" Visibility="{Binding SeriesLongVisibility}" >

    // property to which the visibility of the above series is bound
    public SeriesVisibility SeriesLongVisibility
     {
                get { return _seriesLongVisibility; }
                set
                {
                    _seriesLongVisibility = value;
                    OnPropertyChanged("SeriesLongVisibility");
                }
            }
     
    // the checkbox delegate command calls this method
           public void ChangeLongVisibility()
            {
                ChartArea.DataSeries.SuspendNotifications();
                if (SeriesLongVisibility == SeriesVisibility.Collapsed)
                    SeriesLongVisibility = SeriesVisibility.Visible;
                else { SeriesLongVisibility = SeriesVisibility.Collapsed; }
                ChartArea.DataSeries.ResumeNotifications();
            }

    Thanks,

    Jake
  2. Ves
    Admin
    Ves avatar
    2927 posts

    Posted 06 Oct 2011 Link to this post

    Hi Jake,

    We are not aware of such problem in the current version of RadChart and it is not reproduced in our local tests. Can you please open a formal support ticket and attach a small runnable project, which demonstrates it? Once we are able to reproduce it we will get back to you with more details. Thank you.

    Best regards,
    Ves
    the Telerik team

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

  3. Jake
    Jake avatar
    7 posts
    Member since:
    Sep 2011

    Posted 06 Oct 2011 Link to this post

    Hello Ves,

    Due to company constraints and policies, I am not able to upload our sample; however, we believe we have found a solution to our problem. We have five seriesmappings on our chart with 50-3000 points in each series. Upon applying the expresssion dark theme, changing the visibility of any seriesMapping after the chart was loaded resulted in the chance for a null reference exception. The problem disappeared after removing the theme and leaving it default.

    Let me know if this helps, or if there is anything else I can provide.

    Thanks,

    Jake
  4. Ves
    Admin
    Ves avatar
    2927 posts

    Posted 11 Oct 2011 Link to this post

    Hi Jake,

    Thanks for the additional details. Still, I am afraid we are not able to reproduce it. Please, find attached a modified version of the Simple Filtering example, which works as expected. You can paste it in the corresponding folder in your local installation, add reference to Telerik.Windows.Themes.Expression_Dark.dll and give it a try.

    Kind regards,
    Ves
    the Telerik team

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

Back to Top