Jump to content
Software FX Community

Custom Gridline duplicated


Recommended Posts

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. 
Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...