RibbonButton - Invoke Click

Posted by: info on 24 March 2020, 9:27 pm EST

  • Posted 24 March 2020, 9:27 pm EST

    good morning,
    I made a procedure that duplicates the commands on the ribbon in the application button.
    On click, I would like to perform the click of the ribbon button.
    How can I do?
    Regards,
    Marco
  • Replied 25 March 2020, 8:36 pm EST


    Hi Marco,

    As per my understanding, you want to perform some specific tasks on the RibbonButton click which you can do using RibbonButton Click event. Please see the documentation link demonstrating about the event:

    https://www.grapecity.com/componentone/docs/win/online-classicribbon/C1.Win.C1Ribbon.4.5.2~C1.Win.C1Ribbon.RibbonButton~Click_EV.html

    If you have any other interpretation then please let me know in brief and if possible share a stripped-down sample. It will help us to assist you in a better way.

    Regards,
    Prabhat Sharma.
  • Replied 25 March 2020, 11:40 pm EST

    Hi Prabhat, thanks for the reply but I have not explained well what I would like to do.

    I would like to invoke the click on a RibbonButton by code.

    For example:

    RibbonButton button = new RibbonButton();
    button.Click += SomeTask;
    button.PerformClick();

    There isn't a PerformClick() method on RibbonButton... Is there any other way to do it?

    This would be very useful when replicating the structure of the ribbon bar on a menu, automatically with a recursive procedure. Currently everything works, except the click invoke and I would not associate it button by button.


    I attach an example.
    Thanks, Regards, Marco
  • Replied 26 March 2020, 11:13 pm EST

    Hi Marco,

    Sorry, the RibbonButton does not have any PerformClick() method but you can use standard MS Button as RibbonItem and use it's PerformClick() method.
    You can go through the following link and learn how to embed your button to the Ribbon:
    https://www.grapecity.com/componentone/docs/win/online-classicribbon/embeddingatextboxina.html

    Regards,
    Prabhat Sharma.
  • Replied 27 March 2020, 3:38 am EST

    Hi Prabhat,
    Thanks for the reply, however, consider the possibility of implementing this method which would give us the possibility of creating new functions, such as the one indicated.
    Regards
  • Replied 29 March 2020, 10:36 pm EST

    Hi Marco,

    We have forwarded your request to the developers and will let you know once we get any updates on this from their end.
    [Internal Tracking ID: 429341]


    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