peterz Posted April 14, 2008 Report Share Posted April 14, 2008 How can I disable the analysis gallery commands for the statistical extnesion? I am using this code: chart1.Commands[CommandId.Gallery].SubCommands.Clear(); chart1.Commands[CommandId.Gallery].Enabled = false; But when I right click on a series I can still see the stats gallery types in the context menu. How can I remove or disable them? I'm trying to lock down the gallery type and and prevet the use r from changin it. Link to comment Share on other sites More sharing options...
peterz Posted April 14, 2008 Author Report Share Posted April 14, 2008 Here is a more compete code snippet: Statistics stats = new Statistics(); stats.Chart = chart1; chart1.GalleryAttributes = stats.Gallery.Regression; stats.Studies.Add(StudyGroup.XYCorrelation); chart1.Commands[CommandId.Gallery].SubCommands.Clear(); chart1.Commands[CommandId.Gallery].Enabled = false; Link to comment Share on other sites More sharing options...
maried Posted April 15, 2008 Report Share Posted April 15, 2008 You can remove the gallery command from toolbar, context menu and series context menu. Here is the code: chart1.ToolBar.RemoveAt(4); // removes gallery command from toolbarchart1.Commands[(int)CommandId.ContextMenuSeries].SubCommands.RemoveAt(0); // removes gallery command from series context menu chart1.Commands[ CommandId.ContextMenuBack].SubCommands.RemoveAt(4); // removes gallery command from context menu Link to comment Share on other sites More sharing options...
peterz Posted May 7, 2008 Author Report Share Posted May 7, 2008 Doing this does not remove the gallery selection from the chart's properties dialog's combo box on the Series tab. How do I remove or disable it there? Link to comment Share on other sites More sharing options...
Frank Posted May 8, 2008 Report Share Posted May 8, 2008 You can't. You can however disable the gallery changing functionality altogether by doing: chart.AllowChanges &= ~(AllowChanges.GlobalGallery | AllowChanges.SeriesGallery); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.