Ori Posted October 30, 2012 Report Share Posted October 30, 2012 HI, recently I upgrade from chartFX 6.2 to 7.0 using the Wrapper. at the moment I'm facing many differences with the chart behavior, but the most annoying thing is that: When I'm trying to add a sub-command to the Context Menu (as was before the wrapper), I get and an Out-Of-Range exception: System.ArgumentOutOfRangeException occurred Message=Specified argument was out of the range of valid values. Parameter name: commandId Source=ChartFX.WinForms ParamName=commandId StackTrace: at ChartFX.WinForms.SubCommandCollection.a(Int32 A_0) at ChartFX.WinForms.SubCommandCollection.Insert(Int32 index, Int32 commandId) at SoftwareFX.ChartFX.Wrapper.Command.InsertSubCommands(Int32 index, Int32 commandId) at SPC.frmSPC.SetChartCommands() in C:\SPC\SPC\frmSPC.cs:line 2303 InnerException: ----------------------- I don't understand what went wrong.. and couldn't find any reference about that while using a wrapper. please help. Thank you! this is the code I use: private void SetChartCommands() { #region set the tool bars this.cfxChart.ToolBar = true; this.pbLegend.Visible = true; Color myColor = Color.FromArgb(78, 119, 200); this.cfxChart.ToolBarObj.BackColor = myColor; this.cfxChart.ToolBarObj.RemoveAt(6,1); SoftwareFX.ChartFX.Wrapper.CommandBar cmds = this.cfxChart.Commands; cmds[(int)SoftwareFX.ChartFX.Wrapper.CommandID.PersonalizedOptions].Enabled = false; cmds[(int)SoftwareFX.ChartFX.Wrapper.CommandID.Gallery].Enabled = false; try { cmds[(int)SoftwareFX.ChartFX.Wrapper.CommandID.ContextMenuBack].RemoveSubCommand(4); } catch { } cmds[(int)SoftwareFX.ChartFX.Wrapper.CommandID.ContextMenuSeries].RemoveSubCommand(0); #endregion #region add the cleaning command this.cfxChart.Commands.AddCommand(4); this.cfxChart.Commands[4].Style = SoftwareFX.ChartFX.Wrapper.CommandStyle.Transposed; this.cfxChart.Commands[4].Text = "Clean/Unclean"; this.cfxChart.Commands[4].Picture = this.cfxChart.Commands.AddPicture(this.imageListTreeView.Images[7]); this.cfxChart.Commands[(int)SoftwareFX.ChartFX.Wrapper.CommandID.ContextMenuSeries].InsertSubCommands(1, 0); this.cfxChart.Commands[(int)SoftwareFX.ChartFX.Wrapper.CommandID.ContextMenuSeries].SubCommandID[0] = 4; #endregion ... Ori Quote Link to comment Share on other sites More sharing options...
Ori Posted December 12, 2013 Author Report Share Posted December 12, 2013 Got back to deal with this system and I'm still looking for a way to solve it... Anyone? 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.