Page 1 of 1

Hiding menu in report designer control

Posted: Mon Apr 08, 2013 8:03 am
by robocik
I want to use StiWpfDesignerControl in my wpf application. But my problem is that I'm unable to hide File menu in the ribbon. I've tried many different approaches:

Code: Select all

StiOptions.Designer.ShowDesignerControlMainMenu = false;
StiOptions.Designer.Ribbon.ShowMainMenuNew = false;
StiOptions.Designer.Ribbon.ShowMainMenuReportNew = false;
StiConfig.Load();
StiWpfMainMenuService service =
(StiWpfMainMenuService) StiConfig.Services.GetService(typeof(StiWpfMainMenuService));
service.ShowHelp = false;
service.ShowFileFormNew = false;
service.ShowFileReportNew = false;
service.ShowFilePageNew = false;
service.ShowFile = false;
service.ShowFileReportOpen = false;
            
var menuService=(StiWpfMainMenuService)stiWpfDesignerControl1.Services.GetService(typeof (StiWpfMainMenuService));
menuService.ShowHelp = false;
menuService.ShowFileFormNew = false;
menuService.ShowFileReportNew = false;
menuService.ShowFilePageNew = false;
menuService.ShowFile = false;
menuService.ShowFileReportOpen = false;
stiWpfDesignerControl1.RefreshRibbonMainMenu();
var menuService1 = StiWpfMainMenuService.GetService(stiWpfDesignerControl1);
menuService1.ShowHelp = false;
menuService1.ShowFileFormNew = false;
menuService1.ShowFileReportNew = false;
menuService1.ShowFilePageNew = false;
menuService1.ShowFile = false;
menuService1.ShowFileReportOpen = false;
stiWpfDesignerControl1.RefreshRibbonMainMenu();
StiWpfStandardToolbarService stdToolbar = StiWpfStandardToolbarService.GetService();
stdToolbar.ShowReportNew = false;

stiWpfDesignerControl1.RefreshToolbars();
stiWpfDesignerControl1.RefreshRibbonMainMenu();
stiWpfDesignerControl1.RefreshRibbonReportFile();
but still File menu with all commands (New, Open) are visible. Can you tell me how I can hide File menu in ribbon in StiWpfDesignerControl?

Re: Hiding menu in report designer control

Posted: Mon Apr 08, 2013 9:22 am
by RDR_Norkart
I think it is imortant to create your StiWpfDesignerControl AFTER you have set your options.
So you could try to set all your options først and then create/open your designer.

We use this:
InitierStiDesigner(); //All our options...
var stiDesigner = new StiWpfDesignerControl { Report = rapport };

Re: Hiding menu in report designer control

Posted: Mon Apr 08, 2013 11:35 am
by robocik
Thanks for quick response. You suggestion worked but... I can hide for example New and Open menu item but I don't know how to hide entire File menu?
I also want to hide Open button for Quick Access toolbar, but I don't see property for this. How can I accomplish this task?

Re: Hiding menu in report designer control

Posted: Tue Apr 09, 2013 11:49 am
by HighAley
Hello.

Please, try to set the static option:

Code: Select all

StiWpfDesignerControl.ShowQuickToolbar = false;
It's hard to hide the File menu item. But we can disable it. If this option will satisfy your needs, please, let us know and we will add it.

Thank you.

Re: Hiding menu in report designer control

Posted: Wed Apr 10, 2013 9:31 am
by robocik
Ok, I will ask our customer if this is needed. But for now thanks for your help :)

Re: Hiding menu in report designer control

Posted: Thu Apr 11, 2013 10:59 am
by HighAley
Hello.

We are waiting for your answer.

Thank you.