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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to programmatically set the Width for the Popup in the AutoComplete control?

Platform: WPF |
Control: AutoComplete |
.NET Framework: 4.5 |
Product Version:
Tags: wpf

Initially, the width for the popup is always smaller than the AutoComplete control width, but to initially increase the width for the popup, you can programmatically set the desired width for the popup.

To set the width for the popup in the AutoComplete control, get the popup from the AutoCompleteControl template and set the MinWidth for the popup.

The following code example illustrates how the popup for the AutoComplete is set narrower than the initial.


// To programmatically set the PopUp Width in c#
public partial class MainWindow : Window
        public MainWindow()
          List<String> ProductSource = new List<String>();
          this.AutoCompleteControl.CustomSource = ProductSource;
          AutoCompleteControl.Loaded += auto1_Loaded;
        void auto1_Loaded(object sender, RoutedEventArgs e)
            Popup pop = AutoCompleteControl.Template.FindName("PART_Popup", AutocompleteControl) as Popup;
            if (pop != null)
                pop.MinWidth = 200;          

The following screenshot illustrates the output.


Figure 1: Popup width changed

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment
Eric T Carter
Aug 10, 2016
i have to check this out now and come back with feedback.but l do trust this source
Emanuele Quarello
Oct 04, 2016
Could you please explain this line?
 Popup pop = AutoCompleteControl.Template.FindName("PART_Popup", Autocomplete Control) as Popup;

What "Autocomplete Control" is supposed to be?


Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile