Joe Posted April 2, 2008 Report Posted April 2, 2008 Hi, I've to remove some tool buttons in the chart control. The code snippet works fine for normal commands SoftwareFX.ChartFX. Command cmd = chart1.ToolBarObj.Commands[(int)SoftwareFX.ChartFX.CommandID.Gallery]; int index = 0;index = cmd.FindSubCommandID((int)SoftwareFX.ChartFX.CommandID.Candlestick); if (index > -1) cmd.RemoveSubCommand(index); It's plausible that there are no CommandIDs for 'statistical Studies' nor the statistical gallery types in ChartFX.CommandID, but where can I find those IDs? It seems that I not see the forest for the trees best regards Joe
Frank Posted April 3, 2008 Report Posted April 3, 2008 The commands added by the extensions (e.g. Statistical) are actually Dynamic as there may be more than one extension added. What exactly are you trying to do with those? I may be able to give you some pointers on how to achieve it.
Joe Posted April 3, 2008 Author Report Posted April 3, 2008 Hi Frank, I want to remove all statistic gallery types except 'BoxAndWhisker' also the 'statistic studies' button should be removed in the toolbar. I figured out that e.g. 'Histogramm Chart' has an ID = 29954, but it is unstable to code it like this (because of upcoming changes). I would prefer a saver way, if ther is one. best regards Joe
Frank Posted April 7, 2008 Report Posted April 7, 2008 This is actually not as easy at it seems. The problem is that these commands are added by the extension dynamically when it is attached to the chart. So even if you remove them they will be re-added when the extension re-attaches. The extension re-ataches in many situations, one of the most common ones is during serialization. When you save the chart settings (either through the Export method or through personalization) the extensions get detached before saving and re-attached afterwords. At this moment there is no API to tell the statistical extension not to add certain galleries or toolbar options so there is no reliable way or removing these options.
Joe Posted April 8, 2008 Author Report Posted April 8, 2008 hmmm, not so fine ..., but thats the answer I expectet after my tests Do you plan an update to solve the problem in future?
Frank Posted April 8, 2008 Report Posted April 8, 2008 Not likely to make it in an update (SP) since it requires major changes. Definitely will not be done in 6.2 as there is a new version already available (7.0). Possibly in a later version.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.