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

Set Popup Width for Autocomplete

Thread ID:

Created:

Updated:

Platform:

Replies:

143528 Mar 25,2019 01:21 PM UTC Mar 26,2019 11:16 AM UTC WPF 1
loading
Tags: AutoComplete
James Randle
Asked On March 25, 2019 01:21 PM UTC

Hi,
I have followed the instructions below to programmatically set the width of the autocomplete popup.

https://www.syncfusion.com/kb/3604/how-to-programmatically-set-the-width-for-the-popup-in-the-autocomplete-control

Unfortunately, this only sets the size of the popup, and not the size of the control within the popup that is actually displaying the results.
I have attached an image to demonstrate this, but even your example exhibits the same problem, which is why the items are displayed in the centre of the popup!

Cheers,
James.

Attachment: ResizeNotWorking_b879765.zip

Jagadeesan Pichaimuthu [Syncfusion]
Replied On March 26, 2019 11:16 AM UTC

Hi James, 
 
Thanks for using Syncfusion product. 
 
We have checked the reported problem in our end and you can resolve this issue by setting the width of the ListBox. Please refer the below code snippet below. 
 
void auto1_Loaded(object sender, RoutedEventArgs e) 
{ 
     Popup pop = AutoComplete1.Template.FindName("PART_Popup", AutoComplete1) as Popup; 
     ListBox listBox = AutoComplete1.Template.FindName("PART_Container", AutoComplete1) as ListBox; 
 
     if (pop != null) 
     { 
         pop.Width = 210; 
         listBox.Width = 200; 
     } 
} 
 
And also please find the screenshot and modified sample regarding it below: 
 
 
 
Let us know whether this helps also if you need any further assistance on this. 
 
Regards, 
Jagadeesan

CONFIRMATION

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

;