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

Disable right-click Context Menu RadTextBoxControl

3 Answers 79 Views
TextBoxControl
This is a migrated thread and some comments may be shown as answers.
Damien
Top achievements
Rank 1
Damien asked on 25 Apr 2018, 08:01 AM

I have quite a number of RadTextBoxControls in my application, and I need to disable the right-click context menu on all of them - how can I do this and is there a way to do it on all of them at the same time so that it is the default?

 

thanks.

 

Damien

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 25 Apr 2018, 11:32 AM
Hi Damien,

The easiest way is to handle the ContextMenuOpening event. To easily replace it in all places you can create a custom control:
[ToolboxItem(true)]
class MyTextBox : RadTextBoxControl
{
    public MyTextBox()
    {
        this.ContextMenuOpening += MyTextBox_ContextMenuOpening;
    }
  
    private void MyTextBox_ContextMenuOpening(object sender, TreeBoxContextMenuOpeningEventArgs e)
    {
        e.Cancel = true;
    }
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Damien
Top achievements
Rank 1
answered on 26 Apr 2018, 05:42 AM
So I would create this custom control and use it instead of the standard RadTextBoxControl?
0
Dimitar
Telerik team
answered on 26 Apr 2018, 08:18 AM
Hi Damien,

You will have to replace the RadTextBoxControl with the custom control where the context menu should not be available. 

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
TextBoxControl
Asked by
Damien
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Damien
Top achievements
Rank 1
Share this question
or