We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

changing context menu does not work

Thread ID:





124461 Jun 11,2016 10:58 AM UTC Jun 14,2016 11:20 AM UTC WPF 3
Tags: AutoComplete
Barry Gendenshtein
Asked On June 11, 2016 10:58 AM UTC

I've tried to change the context menu of an AutoComplete control but it shows the default context menu (Cut, Copy, Paste) instead of mine.

my code:

AutoComplete createAccountName = new AutoComplete();
ContextMenu cMenuExample = new ContextMenu();
cMenuExample.Items.Add("Change Name");
createAccountName.ContextMenu = cMenuExample;

Venkateshwaran Ramdoss [Syncfusion]
Replied On June 13, 2016 12:29 PM UTC

Hi Barry,

We can hide the default ContextMenu of the AutoComplete by setting the ContextMenu value as Null. The AutoComplete's TextBox can be got using VisualUtils method. We have created a sample for the same, in which have created a new ContextMenu for AutoComplete and set the default ContextMenu of TextBox as Null. Please download the same from the below link.

Sample: AutoCompleteContextMenusample

Venkateshwaran V.R.

Barry Gendenshtein
Replied On June 13, 2016 06:05 PM UTC

Hi, thanks for the fast response. 
Your solution works if the AutoComplete control is not created at runtime, but in my program it does and I receive a "System.NullReferenceException"  since the textBox does not get the reference to the TextBox descendant of the AutoComplete using the VisualUtils method and remains null...
Try creating the AutoComplete control at runtime as I did in my code in the first message.

Venkateshwaran Ramdoss [Syncfusion]
Replied On June 14, 2016 11:20 AM UTC

Hi Barry,

We were able to reproduce the reported issue in version 13.4. However, the issue is already fixed in our latest version 14.1. Can you please upgrade to our latest version 14.1?

Venkateshwaran V.R.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon