Q:

Set grid linetype as dash in C# Chart Control

I tried
Chart1.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.Dash;
Chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash;

but is not working.
The complete code for setting chart control is as below.The grid line becomes wider after my setting for LineDashStyle.
Chart1.ChartAreas[0].AxisX.MajorGrid.LineDashStyle = ChartDashStyle.DashDotDot;
Chart1.ChartAreas[0].AxisY.MajorGrid.LineDashStyle = ChartDashStyle.Dash;
Chart1.ChartAreas[0].AxisX.MajorTickMark.Enabled = false;
Chart1.ChartAreas[0].AxisY.MajorTickMark.Enabled = false;
Chart1.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
Chart1.ChartAreas[0].AxisX.MajorGrid.Interval = 3600;
Chart1.ChartAreas[0].AxisX.Interval = 3600;
Chart1.ChartAreas[0].AxisX.Maximum = 3600 * ((int)m / 3600 + 1);
Chart1.ChartAreas[0].AxisX.Minimum = 0;
Chart1.Series.Add("Latitude");
Chart1.ChartAreas[0].AxisX.Title = "Epoch[h]";
Chart1.ChartAreas[0].AxisX.TitleFont = new Font("TimesNewRoman", 10);
Chart1.ChartAreas[0].Position.Width = 45;
Chart1.ChartAreas[0].Position.Height = 30;
Chart1.Series[0].ChartType = SeriesChartType.Line;
Chart1.Series[0].Points.DataBindXY(time,rms_x);  
Chart1.ChartAreas[0].AxisY.Title = "Latitude[m]";
Chart1.ChartAreas[0].AxisY.TitleFont = new Font("TimesNewRoman", 10);
Chart1.ChartAreas[0].AxisX.LabelStyle.IsStaggered = false;

//Chart1.ChartAreas[0].AxisX.LabelStyle.Interval = 1;
Chart1.ChartAreas[0].Name = "Latitude";
Chart1.ChartAreas[0].Position.X = 0;
Chart1.ChartAreas[0].Position.Y = 0;
Chart1.Series[0].ChartArea = "Latitude";

Here is the picture I got.'LinshDashStyle' has been update to dash in the first figure and the second figure is before updating.

A:

txt_Report.Text += ts.ReadData(textBox1.Text, isChecked);
txt_Report.Text += ts.DrawGraph(chart1, textBox1.Text, isChecked);

Thanks for all of your answers and comments, and I finnaly found that I passed Chart to an object to set its property is the reason.

