Value in the SFAutocomplete is not displaying, but can select from dropdown.

Hi,

The value in the sfautocomplete dropdown is not showing but value is there and I can select the value.Afrter selection it is showing in the selected space.But in dropdown its not showing.

Regards,
Gourav

Xaml - -

 
Text="{Binding Text, Mode=TwoWay}" 
DataSource="{Binding ItemsSource}" 
ItemTemplate="{StaticResource itemTemplate}" 
BorderColor="{Binding ValidationColor}"
ShowSuggestionsOnFocus="False"
SuggestionMode="Custom" 
SelectedItem = "{Binding SelectionObject,Mode=TwoWay}"
DisplayMemberPath="Name" 
SelectedValuePath="Name"
Watermark="Please Enter Location" 
AutoCompleteMode="Suggest" 
HeightRequest="100"
DropDownItemHeight="50" 
MaximumDropDownHeight="200"
NoResultsFoundText="No Results Found"
MultiSelectMode="Token"
TokensWrapMode="Wrap"
IsSelectedItemsVisibleInDropDown="False"
ShowClearButton="False"/>

Viewmodel --

using AutoComplete_Online.Model;
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Globalization;
using Xamarin.Forms;
using static AutoComplete_Online.Model.CountryModel;
using static AutoComplete_Online.Model.LocationsGet;

namespace AutoComplete_Online
{
    public class ViewModel : INotifyPropertyChanged
    {
        #region Properties

        

        public event PropertyChangedEventHandler PropertyChanged;

        private ObservableCollection itemsSource = new ObservableCollection();

        public ObservableCollection ItemsSource
        {
            get
            {
                return itemsSource;
            }

            set
            {
                itemsSource = value;
                RaisepropertyChanged("ItemsSource");
            }
        }

        private ObservableCollection<object> selectionobject = new ObservableCollection<object>();
        public ObservableCollection<object> SelectionObject
        {
            get { return selectionobject; }
            set
            {
                selectionobject = value;
                RaisepropertyChanged("SelectionObject");
            }
        }      
       

        private string text;

        public string Text
        {
            get
            {
                return text;
            }

            set
            {
                text = value;
                if (text != null && text.Length > 0) 
                {                              
                    GetData(text);
                }
                else
                {
                    //ValidationColor = Color.Red;
                    //ErrorMessage = "Please enter valid 6 digits PinCode : 600001 or 600100";
                }
                RaisepropertyChanged("ItemsSource");
            }
        }
        

        #endregion

        #region Constructor
        public ViewModel()
        {
            
        }

        #endregion

        public ObservableCollection GetValidData(ObservableCollection obj)
        {
            return obj;
        }
        #region Methods

        public async void GetData(string cityCode)
        {
            RestService restservice = new RestService();
            ItemsSource = await restservice.RefreshDataAsync(cityCode);

            GetValidData(ItemsSource);

            if (ItemsSource.Count <= 0)
            {
                //ValidationColor = Color.Red;
                //ErrorMessage = "No area available";
            }
        }

        void RaisepropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }

        #endregion

    }

    public class StringToColorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value.ToString() == "_DeliveryStatus")
            {
                return Color.SkyBlue;
            }
            return Color.Red;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

}



3 Replies

PA Paul Anderson S Syncfusion Team September 18, 2018 09:32 AM UTC

Hi Gourav, 
  
Greetings from Syncfusion. 
  
Can you please let us know in which platform the reported behavior is noticed? Also can you share the Template used for the Dropdown item to be displayed? You can check defining the WidthRequest and HeightRequest of the controls used in the ItemTemplate which may be also a cause of the issue. 
  
Please let us know if you have any concerns. 
  
Regards, 
Paul Anderson 



GR Gourav Roy September 18, 2018 11:52 AM UTC

Hey Paul,
  
Is there any way to send you my private project ? I can't share this in public field like here.

Regards,
Gourav


PA Paul Anderson S Syncfusion Team September 18, 2018 12:09 PM UTC

Hi Gourav, 
  
Thanks for the update. 
  
We have created a new support incident to have further followups as you per your request to share the files in private. We will assist you through incident under your Direct Trac account. 
 
  
Our Direct Trac support system can be accessed from the following link: 
                               
  
Regards, 
Paul Anderson 


Loader.
Up arrow icon