New to Telerik UI for WPFStart a free 30-day trial

Exception Thrown Attempting to Set StrokeDashArray on CartesianChartGrid

Updated on Sep 15, 2025

Environment

Product Version2019.2 902
ProductRadChartView for WPF

Description

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."

Solution

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

XAML
	<telerik:RadCartesianChart.Grid>
		<telerik:CartesianChartGrid MajorXLineDashArray="4,2" MajorYLineDashArray="4,2" >
	</telerik:RadCartesianChart.Grid>
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support