This question is locked. New answers and comments are not allowed.
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:
Thanks,
Jake
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