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.
Unfortunately, activation email could not send to your email. Please try again.

How to fill SfAutoComplete in the Horizontal StackLayout

Thread ID:

Created:

Updated:

Platform:

Replies:

132533 Sep 6,2017 11:59 PM Sep 14,2017 08:10 AM Xamarin.Forms 5
loading
Tags: SfAutoComplete
spark
Asked On September 6, 2017 11:59 PM

  <StackLayout Orientation="Horizontal"  Padding="7,5,5,0">
            <StackLayout HorizontalOptions="StartAndExpand" VerticalOptions="Start">
                <autocomplete:SfAutoComplete HeightRequest="40" />
            </StackLayout>
            <Button  x:Name="viewModeChangeBtn" VerticalOptions="Start" WidthRequest="50"  HeightRequest="40" TextColor="White" BackgroundColor="#F8B4C3"
                          Text="List" />
            <Button  x:Name="viewFilterBtn"  VerticalOptions="Start" WidthRequest="50" HeightRequest="40" TextColor="White" BackgroundColor="#F8B4C3"
                          Text="Filter" />
        </StackLayout>


I'm trying to fill the SfAutoComplete in StackLayout for iPhone and iPad.
Fixed width value is working for SfAutoComplete but I don't know how to set auto width like StartAndExpand for SfAutoComplete .
Please help me.

Thanks in advance.


Vanaja  Annasamy [Syncfusion]
Replied On September 8, 2017 05:47 AM

uHi Spark, 
  
Thank you for contacting Syncfusion support. 
  
We suggest you to set Orientation of StackLayout into Vertical to fill the SfAutoComplete in StackLayout. We have created the sample for the reference in which HorizontalOption of SfAutoComplete is set StartAndExpand so that AutoComplete is expanded to fill in the StackLayout. Please download the same from the below link. 
  
  
Please run the sample and revert whether if you have any concern on this. 
  
Regards, 
Vanaja R.A. 


spark
Replied On September 11, 2017 07:38 PM

Thank you for reply.

I want to make Autocomplete and 2 Buttons in one line. so I need to set Horizontal for Stacklayout.

But don't worry I already solved this problem like this.  If any better solution, please let me know.

Thanks,

  <StackLayout Orientation="Horizontal"  Padding="7,5,5,0" x:Name="autocompleteStack" >
            <StackLayout HorizontalOptions="StartAndExpand" VerticalOptions="Start">
                <autocomplete:SfAutoComplete HeightRequest="40"  x:Name="autoComplete" />
            </StackLayout>
            <Button  x:Name="viewModeChangeBtn" VerticalOptions="Start" WidthRequest="50"  HeightRequest="40" TextColor="White" BackgroundColor="#F8B4C3"
                          Text="List" />
            <Button  x:Name="viewFilterBtn"  VerticalOptions="Start" WidthRequest="50" HeightRequest="40" TextColor="White" BackgroundColor="#F8B4C3"
                          Text="Filter" />
  </StackLayout>




        private void AutocompleteStack_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Width")
                autoComplete.WidthRequest = autocompleteStack.Width - 125;
        }





Selva Kumar  Veerakrishnan [Syncfusion]
Replied On September 12, 2017 09:50 AM

Hi Spark,

Thanks for your response.

We have modified the sample with the Grid. In that we have used our SfAutoComplete control and the two buttons in a same row. Please download the sample from the link given below.

Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/SfAutoComplete_LayoutOption356139447.zip

Please let us know if you have any concern on this.

Regards,
Selva Kumar V

spark
Replied On September 13, 2017 07:59 PM

It also works fine. Thank you.



Padmini Ramamurthy [Syncfusion]
Replied On September 14, 2017 08:10 AM

Hi Spark, 
  
Thanks for your response and please get back to us if you need any other assistance on this. 
  
Regards, 
Padmini R. 


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.

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.

;