Current filter:
                                You should refresh the page.
                                • Sasha (DevExpress Support) 01.07.2019

                                  Hello Vlasta,

                                  I need to understand your task completely to provide you with the most precise solution. Is this correct that you need to add items to your RibbonControl and call Grid methods? If so, you can handle an item's BarItem.ItemClick or RibbonControl.ItemClick event. If it doesn't help, please describe your task and difficulties you've faced in greater detail.

                                • Vlasta 01.07.2019

                                  I have many XtraUserControl files with GridControl. GridControls I call within DocumentManager as individual bookmarks (see picture). I would like to have only one Ribbon for all XtraUserControls with grids.

                                  I'm sending the whole project.

                                • Vlasta 01.07.2019

                                  And still picture ... 

                                1 Solution

                                Creation Date Importance Sort by

                                Hi,

                                I have reviewed your project and see that you have a few XtraUserControls with ribbons. These XtraUserControls  contain UCRibbonTable1 and their ribbons are merged with UCRibbonTable1's ribbon. If you need to catch the moment when the barBtnPrint item is clicked, override the XtraUserControl's OnLoad method and subscribe to the BarButtonItem.ItemClick event:

                                [C#]
                                protected override void OnLoad(EventArgs e) { base.OnLoad(e); var barItem = UcRibbonTable.Ribbon.Items["barBtnPrint"]; barItem.ItemClick += BarItem_ItemClick; }

                                Call the GridControl.ShowPrintPreview method in the ItemClick event handler.

                                Let me know if this information is helpful.

                                • Vlasta 01.12.2019

                                  Hello Svetlana,
                                  thank you for helping to solve the problem. It's just uncomfortable that I will have to repeat the service code in all XtraUserControls.

                                  I have one more problem (which is unrelated to this). If the XtraUserControls window is undocking, the Print preview window opens twice (see picture).

                                • Vlasta 01.12.2019

                                  I'm still sending my code.
                                  Thank you for your help.

                                • Svetlana (DevExpress Support) 01.14.2019

                                  Hi,

                                  To not repeat the same code for your each XtraUserControl, you can create a base XtraUserControl. Place UCRibbonTable1 into it and override the OnLoad method in the same manner I showed previously. Then, inherit all your XtraUserControls from this control.

                                  Regarding the second issue, it occurs since the XtraUserControl.OnLoad method is called again on making XtraUserControl's document float. I have discovered this by inserting a break-point in the OnLoad method. To avoid this shortcoming, unsubscribe from this event before subscribing to it.

                                  Let me know if you need further assistance.