XTr33m Posted April 2, 2014 Report Share Posted April 2, 2014 Hi, I have a custom gridline added to a WebForm. When I click on any toolbar button, the custom gridline gets duplicated in the legend box. Please see image attached. Regards. Quote Link to comment Share on other sites More sharing options...
rocioZ Posted April 2, 2014 Report Share Posted April 2, 2014 Please make sure you are adding the CustomLegendItem inside a !IsPostBack block; as otherwise the CustomLegendItem will be added in every callback request. Please refer to the code below: [C#] if (!IsPostBack){ CustomLegendItem cli = new CustomLegendItem();cli.MarkerShape = MarkerShape.HorizontalLine;cli.Color = Color.Red;cli.Text = "Custom Grid Line" ;Chart1.LegendBox.CustomItems.Add(cli);} Adding all the code that will be executed just once inside that block would be a good practice.I hope this helps. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.