I have a picker where I update the current address of the user/retailer. The selected value is from my database I want to set the selected item of my picker.
My XAML:
<local:CustomPicker x:Name="provincePicker" SelectedIndexChanged="provincePicker_SelectedIndexChanged" Unfocused="provincePicker_Unfocused" SelectedItem="{Binding DisplayText}" ItemsSource="{Binding ProvinceID}" ItemDisplayBinding="{Binding DisplayText}" StyleClass="fieldForm" IsEnabled="True">
<local:CustomPicker.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<On Platform="Android" Value="HelveticaNeueLTPro-Lt.otf#HelveticaNeueLTPro-Lt"/>
</OnPlatform>
</local:CustomPicker.FontFamily>
XAML.CS
var getCode = conn.QueryAsync<RetailerGroupTable>("SELECT * FROM tblRetailerGroup WHERE RetailerCode=?", code);
var resultCount = getCode.Result.Count;
if (resultCount > 0)
{
var result = getCode.Result[0];
provincePicker.SelectedItem = result.ProvinceID;
}