Spinner with key value.

SanjayTejaniSanjayTejani ✭✭✭USMember ✭✭✭

@Arvindraja

Can you please help me how do i make drop-down control with key value pair, same as used in asp.net.

I am used Xamarin.Android Navtive app.

Tagged:

Answers

  • ArvindrajaArvindraja ✭✭✭ INMember ✭✭✭

    use this code automatic values associate with each item according to the number position i think index start from 0

                    private void spinner_ItemSelected(object sender, AdapterView.ItemSelectedEventArgs e)
                    {
                        var spinner = (Spinner) sender;
                        SelectedCategory = string.Format("{0}", spinner.GetItemAtPosition(e.Position));
                    }
    
  • SanjayTejaniSanjayTejani ✭✭✭ USMember ✭✭✭

    @Arvindraja

    I want to get Id from Spinner.

    Name = test 1, Id=102
    Name = test 2, Id=103
    
Sign In or Register to comment.