Forum Xamarin.Android

Spinner display name base on value

SanjayTejaniSanjayTejani USMember ✭✭✭
edited November 2016 in Xamarin.Android

Hi All,

I have one spinner with country source like.

Name="India" value="1",
Name="Nepal" value="2",
Name="Bhutan" value="3"

I am getting value (2) from database now i want to display ' Nepal ' from spinner, how can i do that?


Best Answer


  • EjazEjaz INMember ✭✭
    edited November 2016

    I guess, you can try
    In Xamarin Forms
    YourPkr.SelectedIndex=2; // 2 as value from your database

    In Android
    YourPkr.SetSelection(2);// 2 as value from your database

Sign In or Register to comment.