C1FlexViewer, disable export button

Posted by: mysql.jorge on 13 October 2020, 2:14 am EST

  • Posted 13 October 2020, 2: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
  • Replied 13 October 2020, 2: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,
  • Replied 13 October 2020, 7:26 pm EST

    Sorry to pressure,
    Anyone can help?
  • Replied 13 October 2020, 7:30 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.
  • Replied 13 October 2020, 7:32 pm 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?
  • Marked as Answer

    Replied 13 October 2020, 10:22 pm 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.
  • Replied 15 October 2020, 8:43 am EST

    Perfect Thanks.
    Just curious, is there an way to know to which button the index belongs to?
  • Replied 15 October 2020, 4:43 pm 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.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels