# Exception Thrown Attempting to Set StrokeDashArray on CartesianChartGrid

## Environment

<table>
	<tbody>
		<tr>
			<th scope="row">Product Version</th>
			<td>2019.2 902</td>
		</tr>
		<tr>
			<th scope="row">Product</th>
			<td>RadChartView for WPF</td>
		</tr>
	</tbody>
</table>

## 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>
```
