Posted 13 October 2020, 11:14 am EST
Howdy,
I’d like to disable the export button in the c1flexviewer, is this possible, and if yes how?
i’ve tried C1FlexViewer1.ShowExportOptions=false but the button still apears.
Thanks in advanced,
Jorge Bastos
Forums Home / ComponentOne / WinForms Edition
Posted by: mysql.jorge on 13 October 2020, 11:14 am EST
Posted 13 October 2020, 11:14 am EST
Howdy,
I’d like to disable the export button in the c1flexviewer, is this possible, and if yes how?
i’ve tried C1FlexViewer1.ShowExportOptions=false but the button still apears.
Thanks in advanced,
Jorge Bastos
Posted 13 October 2020, 11:21 am EST
Hi Again,
I also tried:
C1FlexViewer1.RibbonElements.Export.Visible = False
and produces no efect.
tried:
C1FlexViewer1.RibbonElements.Export.Enabled = False
and with the …export.enable = false the button gets inactive, but i want to hide it.
How can it be done?
Thanks in advanced,
Posted 14 October 2020, 4:26 am EST
Sorry to pressure,
Anyone can help?
Posted 14 October 2020, 4:30 am EST - Updated 3 October 2022, 11:35 pm EST
Hi Jorge,
At our end, using the below-given code snippet, we can Hide the Export button:
C1FlexViewer1.RibbonElements.Export.Visible = False
Please see the screenshot for more clarity.
If you are doing the same and the Export button still appears then please let us know the control version that you are using and in which event you are using this property.
Regards,
Prabhat Sharma.
Posted 14 October 2020, 4:32 am EST
Hi,
Seems to work, BUT, when the ribbon is minimized, doesn’t work, can you test if it’s working?
I have in the form load:
C1FlexViewer1.Dock = DockStyle.Fill
C1FlexViewer1.Visible = True
C1FlexViewer1.Ribbon.Minimized = True
C1FlexViewer1.RibbonElements.Export.Visible = False
but it’s not bein hidden,
Can you check it please?
Posted 14 October 2020, 7:22 am EST
Hello Jorge,
To hide the Export button when the Ribbon is minimized you need to use the code snippet given below:
C1FlexViewer1.Dock = DockStyle.Fill
C1FlexViewer1.Visible = True
C1FlexViewer1.Ribbon.Minimized = True
C1FlexViewer1.RibbonElements.Export.Visible = False
C1FlexViewer1.Ribbon.TopToolBar.Items(13).Visible = False
End Sub
You also need to handle the MinimizedChanged event of Ribbon to make the Export button hide at runtime when minimizing/ maximizing the Ribbon:
AddHandler C1FlexViewer1.Ribbon.MinimizedChanged, AddressOf Ribbon_MinimizedChanged
Private Sub Ribbon_MinimizedChanged(sender As Object, e As EventArgs)
C1FlexViewer1.Ribbon.TopToolBar.Items(13).Visible = False
End Sub
Regards,
Prabhat Sharma.
Posted 15 October 2020, 5:43 pm EST
Perfect Thanks.
Just curious, is there an way to know to which button the index belongs to?
Posted 16 October 2020, 1:43 am EST
Hello,
>>Just curious, is there an way to know to which button the index belongs to?
You can use the Name property of the item to know its index:
For i As Integer = 0 To C1FlexViewer1.Ribbon.TopToolBar.Items.Count-1
Console.WriteLine(C1FlexViewer1.Ribbon.TopToolBar.Items(i).Name + " , "+i)
Next
Regards,
Prabhat Sharma.