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

How to have autocomplete height grow as items are selected

Hi, at the moment I have a grid. Inside this grid is a scrollview, followed by another grid. Inside this Grid, it has 2 columns and many rows. The issue I'm currently having is that the autocomplete doesn't grow in size as more tokens are added. They just get hidden. 

Any tips or suggestions would be greatly appreciated. 

Attachment: MainPage_6a8b74b9.zip

3 Replies

SK Selva Kumar  Veerakrishnan Syncfusion Team February 22, 2019 05:05 AM UTC

Hi Minh,

Greetings from Syncfusion.

In our SfAutoComplete, when selecting multiple item during Token mode, the items will get scrolled inside the SfAutoComplete text box. The size of the control will not change.

Please check by scrolling inside the SfAutoComplete TextBox and let us know if you have any clarification on this.

Selva Kumar V.

MT Minh Tran February 22, 2019 01:56 PM UTC

Hi there,

a scroll in the box is no longer present. The grid that host the data is within a scrollview. Is there a way to get the size to automatically change? 

SK Selva Kumar  Veerakrishnan Syncfusion Team February 25, 2019 12:56 PM UTC

Hi Minh, 
Sorry for the inconvenience. 
We do not have have direct support to change the size of SfAutoComplete. We can use the below given workaournd on SelectionChanged event of SfAutoComplete, during the selection change we have changed the height of SfAutoComplete. 
var autocomplete = (sender as Syncfusion.SfAutoComplete.XForms.SfAutoComplete);
            if (autocomplete.SelectedItem != null && autocomplete.SelectedItem is IList)
                var count = (autocomplete.SelectedItem as IList).Count;
                var extendheight = Math.Ceiling(count / 2d) * 45;
                if (extendheight != 0 && autocomplete.HeightRequest != extendheight)
                    autocomplete.HeightRequest = extendheight;
                else if (extendheight == 0 && autocomplete.HeightRequest != extendheight)
                    autocomplete.HeightRequest = 45;

Please have the sample for the same from the link given below.
Please check with the above sample and let us know if you have any clarification on this. 
Selva Kumar V. 

Live Chat Icon For mobile
Up arrow icon