Click here to Skip to main content
11,479,951 members (44,878 online)
Rate this: bad
good
Please Sign up or sign in to vote.
I have a Silverlight 4 Toolkit Chart with all the axes and series added in code behind.
When styling the horizontal gridlines, only the first gridline has the style applied to.

Does anyone know how to overcome this and aply that style to all gridlines?

The Axis are created like this:
            LinearAxis NovoINYAxis = new LinearAxis();
            NovoINYAxis.Orientation = AxisOrientation.Y;
            NovoINYAxis.Location = AxisLocation.Left;
            NovoINYAxis.Name = "YLinearINAxis";
            NovoINYAxis.AxisLabelStyle = userControl.Resources["IntegerAxisLabelStyle1"] as Style;
            NovoINYAxis.Minimum = 0;
            NovoINYAxis.Margin = new Thickness(2, 0, 2, 0);
            NovoINYAxis.ShowGridLines = true;
 
            Binding binding = new Binding();
            binding.FallbackValue = 10;
            binding.ElementName = "userControl";
            binding.Path = new PropertyPath("MaxIN");
            NovoINYAxis.SetBinding(LinearAxis.MaximumProperty, binding);
 
            binding = new Binding();
            binding.FallbackValue = 0;
            binding.ElementName = "userControl";
            binding.Path = new PropertyPath("MinIN");
            NovoINYAxis.SetBinding(LinearAxis.MinimumProperty, binding);
 
            Style gridLineStyle = new Style(typeof(Line));
            gridLineStyle.Setters.Add(new Setter(Line.StrokeProperty, "White"));
            gridLineStyle.Setters.Add(new Setter(Line.StrokeThicknessProperty, 1));
            gridLineStyle.Setters.Add(new Setter(Line.OpacityProperty, 0.4));
            gridLineStyle.Setters.Add(new Setter(Line.StrokeDashArrayProperty, "6,4"));
            NovoINYAxis.GridLineStyle = gridLineStyle;
            VisualGrafico.Axes.Add(NovoINYAxis);

Apreciate any help.

Anyone? Thanks.
Posted 22-Mar-13 2:25am
Edited 25-Mar-13 0:42am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 235
1 Sergey Alexandrovich Kryukov 215
2 F-ES Sitecore 155
3 Richard MacCutchan 100
4 DamithSL 65
0 Sergey Alexandrovich Kryukov 7,890
1 OriginalGriff 7,556
2 Sascha Lefèvre 3,064
3 Maciej Los 2,491
4 Richard Deeming 2,335


Advertise | Privacy | Mobile
Web02 | 2.8.150520.1 | Last Updated 25 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100