Jump to content
Software FX Community
XTr33m

Custom Gridline duplicated

Recommended Posts

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.

post-37234-0-73192400-1396460599_thumb.jpg

Share this post


Link to post
Share on other sites

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. 

Share this post


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...