Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

Picker selected item showing class name at zero position

$
0
0

I am using picker in my xaml like
<Picker x:Name="pickerService" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" ItemDisplayBinding="{Binding ServiceName }"/>
My Service class is like

       public class Service
        {
          [PrimaryKey, AutoIncrement]
          public int Id { get; set; }
          public string ServiceName { get; set; }
        }

and adding list to picker itemssource like

     List<Service> serviceNames = new List<Service>();
     serviceNames = App.DAUtil.GetServices ();
     pickerService.ItemsSource = serviceNames ;

here I am getting serviceNames list from my local db.When I select a service from picker sometimes it is showing class name at zero position instead of "ServiceName", like "App.MainPage". Please help me to solve this.


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>