New to Telerik UI for WPF? Download free 30-day trial

Exception Thrown Attempting to Set StrokeDashArray on CartesianChartGrid


Product Version 2019.2 902
Product RadChartView for WPF


InvalidOperationException is thrown when setting the StrokeDashArray property of the CartesianChartGrid lines through the MajorXLineStyle or MajorYLineStyle properties.

The error message is: "Specified value of type 'System.Windows.Media.DoubleCollection' must have IsFrozen set to false to modify."


Instead of the StrokeDashArray property of the Line element, set the MajorXLineDashArray and MajorYLineDashArray properties of the CartesianChartGrid element.

    <telerik:CartesianChartGrid MajorXLineDashArray="4,2" MajorYLineDashArray="4,2" > 
In this article