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

How to disable click of RibbonTab in WinForms using C#

1 Answer 101 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Abins
Top achievements
Rank 1
Abins asked on 28 Dec 2018, 03:00 PM

I am using RadRibbonBar which have several Tabs. For one tab, instead of displaying the my group, I need to attach a action to execute. Currently, when I click on any tab, the highlighted area will be visible. But for the particular settings tab, I don't need to tdisplay this area. But I need to attach an action.

 

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 31 Dec 2018, 08:00 AM
Hello, Abins, 

You can prevent the current tab from being changed but also detect when a specific tab is clicked. For this purpose you can handle the RadRibbonBar.CommandTabSelecting and cancel it when the clicked tab is the desired one Then, execute the desired logic. 

public RadForm1()
{
    InitializeComponent();
 
    this.radRibbonBar1.CommandTabSelecting+=radRibbonBar1_CommandTabSelecting;
}
 
private void radRibbonBar1_CommandTabSelecting(object sender, Telerik.WinControls.UI.CommandTabSelectingEventArgs args)
{
    if (args.NewCommandTab== this.ribbonTab2)
    {
        args.Cancel = true;
        RadMessageBox.Show("Tab2 is clicked");
    }
}

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
RibbonBar
Asked by
Abins
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or