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

Disable context menu

1 Answer 627 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Markus
Top achievements
Rank 1
Veteran
Markus asked on 24 Jan 2020, 09:52 AM

Hi dear Telerik Team,

On right clicking I want to open a radial menu. But the standard context menu appears.

How can I disable the context menu and replace by the radial menu?

Thank you.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 29 Jan 2020, 09:34 AM

Hi Markus,

To remove the ContextMenu you need to target the RadWatermarkTextBox. You can do that through the TextBoxStyle property of the RadAutoCompleteBox. You can create a custom style which targets RadWatermarkTextBox and set the ContextMenu property to a new ContextMenu with Visibility set to Collapsed.

<telerik:RadAutoCompleteBox.TextBoxStyle>
    <Style TargetType="telerik:RadWatermarkTextBox">
        <Setter Property="ContextMenu" >
            <Setter.Value>
                <ContextMenu Visibility="Collapsed">
                </ContextMenu>
            </Setter.Value>
        </Setter>                  
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Margin" Value="3 3 0 0"/>
        <Setter Property="Padding" Value="0"/>
    </Style>
</telerik:RadAutoCompleteBox.TextBoxStyle>

I have created a sample project to better demonstrate what I have in mind. You can find it attached to this reply.

Regards,
Dinko
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
AutoCompleteBox
Asked by
Markus
Top achievements
Rank 1
Veteran
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or