This is a migrated thread and some comments may be shown as answers.

Customizing RadPrintSettingsDialog ToolCommandBar

1 Answer 68 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
George C.
Top achievements
Rank 2
Iron
Veteran
George C. asked on 15 Dec 2020, 02:58 AM

Greetings,

Is it possible to customize RadPrintSettingsDialog's ToolCommandBar items programmatically ? For instance, hiding Print Settings button, or just showing Print button and ...  (before runtime) ?

I have the same question with Print Settings Dialog. How to customize the Print Settings Dialog items in aspect of setting visibility of items ?

 

Thanks in advance.


1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Dec 2020, 12:17 PM

Hello, George,   

I suppose that you mean the command bar in the RadPrintPreviewDialog:

Similar to the other dialogs, RadPrintPreviewDialog is a derivative of RadForm. You can access all of its controls via the Controls collection. However, the RadPrintPreviewDialog.ToolCommandBar property gives you direct access to the RadCommandBar that is used.

As a RadCommandBar, ToolCommandBar is arranged in rows, strip elements and items to each strip element:
https://docs.telerik.com/devtools/winforms/controls/commandbar/structure#radcommandbar

You can find below a sample code snippet demonstrating how to hide the print settings button: 

            RadPrintDocument doc = new RadPrintDocument();
            doc.AssociatedObject = new RadGridView();
            RadPrintPreviewDialog dialog = new RadPrintPreviewDialog();
            dialog.ToolCommandBar.Rows[0].Strips[0].Items[1].Visibility = ElementVisibility.Collapsed;
            dialog.Document = doc;
            dialog.ShowDialog();

Thus, you can access every button you want and manage its visibility.

I hope this information helps.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
George C.
Top achievements
Rank 2
Iron
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or