Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8420527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:54:11+00:00 2026-06-10T02:54:11+00:00

i really don’t get how I can use a spinner just like asp.net’s dropdownlist,

  • 0

i really don’t get how I can use a spinner just like asp.net’s dropdownlist, where you have one value that is displayed for the user, and a hidden custom value that I can use with the change event.

like in asp.net, you can just do this:

string value = "somevalue";
dropdownlistID.Items.Add(new ListItem("text",value));

and in the event I can just retrieve it with dropdownlistID.SelectedValue

If anyone have a link that can explain this to me, or any other suggestions, please help!
I’m making an android app in vs2010 with mono for android.

Regards, Marcus

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:54:12+00:00Added an answer on June 10, 2026 at 2:54 am

    you need to create an ArrayAdapter, the same way you would to fill a ListView.

     spinTime = FindViewById<Spinner>(Resource.Id.spinTimeChoose);
     List<string> spinnerItems = new List<string>();
     ArrayAdapter adapter  new ArrayAdapter<string> (this,Android.Resource.Layout.SimpleSpinnerItem,spinnerItems);
    
     adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem);
     spinTime.Adapter = adapter;
     spinTime.ItemSelected += (s, e) =>
     { 
      Log.Debug("SpinnerItems", spinnerItems[e.Position]);           
     }
    

    hope it helps

    edit: i think i now get your question 🙂
    below is an example for an custom Adapter for a list of clearances. sorry for the hardcoded german strings. The important part is the getView method. It gets called everytime a new listitem gets into the view of the user. you have to inflate a new view, or if not null reuse the convertView and fill it with the values from your list.

    class ClearanceListAdapter : BaseAdapter
    {
        private readonly List<Clearance> _clearances;
        private readonly Activity _context;
    
        public ClearanceListAdapter(List<Clearance> Clearances, Activity context)
        {
            _clearances = Clearances;
            _context = context;
        }
    
        public override int Count
        {
            get { return _clearances.Count(); }
        }
    
        public override Java.Lang.Object GetItem(int position)
        {
            return null;
        }
    
        public override long GetItemId(int position)
        {
            return position;
        }
    
        public Clearance GetClearance (int position)
        {
            return _clearances.ElementAt(position);
    
        }
    
        public override Android.Views.View GetView(int position, Android.Views.View convertView, Android.Views.ViewGroup parent)
        {
    
            View view = (convertView ?? _context.LayoutInflater.Inflate(Resource.Layout.ClearanceListItem, parent, false));
    
            Clearance clearance = _clearances[position];
    
    
            view.FindViewById<TextView>(Resource.Id.txtClearanceDescription).Text = clearance.Description;
            view.FindViewById<TextView>(Resource.Id.txtStartDate).Text = clearance.Start.ToString("g");
            view.FindViewById<TextView>(Resource.Id.txtEndDate).Text = clearance.End.ToString("g");
    
            return view;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really don't understand this. I have a simple ASP with 3 div in
As a developer I really don't like writing documentation but when I have to
I really don't want to have to reinvent the wheel with this one. There
I really don't know/have the answer, knowledge to find a resource value using a
I really don't think this has anything to do with ASP.NET MVC 2 itself,
This is one of things that I really don't get. I know that it's
I use this code to get Server Date but I really don't understand.CreateDateTime() is
I really don't get it, I have a multimodule project (snapshots) and I'm using
I really don't understand Javascript. In PHP, I can remove quotes like this: $tags_array
I really don't know if this is a C# thing or an asp.net thing.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.