Jump to content
Software FX Community

Customize context menu not possible


Recommended Posts

I try to add a user command to series context menu. But menu item doesn't appear. I do the same with ChartFX for Windows Forms and there it works. Is it not supported in web version ?

Version 7.0.3306.26568

Here's my code:

ChartFX.WebForms.Command contextMenu = Chart1.Commands[ChartFX.WebForms.CommandId.ContextMenuSeries];

//add Drilldown itembaseCommand = new ChartFX.WebForms.Command(2222);baseCommand.Text = "Drilldown";baseCommand.Style = ChartFX.WebForms.CommandStyles.ShowTextOnly;baseCommand.ImageIndex = -1;baseCommand.Enabled = true;Chart1.Commands.Add(baseCommand);contextMenu.SubCommands.Add(baseCommand.ID);




Link to comment
Share on other sites

It may be a timing issue. Where in the page lifecycle are you executing this code? Make sure it is done before any rendering occurs. If you are already doing it in an event that's prior to any rendering, please post a sample app that reproduces the problem.  Your code works on my end when I paste it in my Page_Load handler.

Link to comment
Share on other sites

 Ok, when I do it in Page_Load it works. But I want to change the context menu content when a user click on a user command. It is not possible to remove or add any commands to context menu when after it was rendered the first time. As an alternative I tried to disable commands but this is not possible also.

I need it for drilldown feature. If user clicks on a sub command of "Drilldown" in context menu. I change chart data and accordingly the available sub commands ( drilldown options ) should change. But context menu could not be changed

Link to comment
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.

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.

  • Create New...