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

  • SEARCH
  • Home
  • 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 9220653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:24:02+00:00 2026-06-18T03:24:02+00:00

I have a listview which is populated from a webservice using an ArrayAdapter. The

  • 0

I have a listview which is populated from a webservice using an ArrayAdapter.
The webservice provides me with all the data I need. Some are just plain textviews yet other alternate between EditText and spinners. I show them easily, also filling up the values where they’re due in EditText fields.

The problem comes with filling up the value of the Spinner. Can I define an adapter within an adapter? Also my data comes from a webservice as an XML passed as a string.

My Spinner code so far inside my Adapter.cs:

if (item.FieldType == "OptionBOX")
    {
        Spinner SpinnerValue = (Spinner) view.FindViewById<Spinner>(Resource.Id.spinnerVal);
        SpinnerValue.Visibility = view.Visibility == ViewStates.Invisible ? ViewStates.Invisible : ViewStates.Visible;

        bool isReadOnly = bool.Parse(item.isReadOnly);

        if (isReadOnly == true)
        {
            SpinnerValue.Enabled = false;
            SpinnerValue.Focusable = false;
            SpinnerValue.FocusableInTouchMode = false;
        }
    }

My data for the spinner is within item.optbox_options.

A table from my XML for easier understanding:

<Table diffgr:id="Table5" msdata:rowOrder="4">
<IdRec>5</IdRec>
<FieldId>1026</FieldId>
<FieldDesc>stanje rezervoarja</FieldDesc>
<FieldType>ComboBOX</FieldType>
<isReadOnly>true</isReadOnly>
<FieldValue>6</FieldValue>
<FieldTextValue>2/4</FieldTextValue>
<OptBox_Options>
<Options><myOPT FieldValue="1" FieldTextValue="0"/><myOPT FieldValue="2" FieldTextValue="1/4"/><myOPT FieldValue="6" FieldTextValue="2/4"/><myOPT FieldValue="7" FieldTextValue="3/4"/><myOPT FieldValue="8" FieldTextValue="4/4"/></Options>
</OptBox_Options>
</Table>

So just to clarify my needs and wants:
Can I use an adapter within an adapter and if I can – how?
How can I display data from the OptBox_Options row? I need to display the value from the FieldTextValue column inside in my spinners.

  • 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-18T03:24:03+00:00Added an answer on June 18, 2026 at 3:24 am

    Resolved using:

    List<string> entries = new List<string>();
    
    String rawXML = item.OptBox_Options;
    
    StringReader stream = null;
    XmlTextReader reader = null;
    
    DataSet xmlDS = new DataSet();
    stream = new StringReader(rawXML);
    // Load the XmlTextReader from the stream
    reader = new XmlTextReader(stream);
    xmlDS.ReadXml(reader);
    
    DataSet myOPTvalues = new DataSet();
    myOPTvalues = xmlDS;
    
    foreach (DataRow row in myOPTvalues.Tables[0].Rows)
    {
        var optItem = new PrevzemSpin();
        optItem.FieldValue = row["FieldValue"].ToString();
        if (optItem.FieldValue.Equals("")) optItem.FieldValue = null;
    
        optItem.FieldTextValue = row["FieldTextValue"].ToString();
        if (optItem.FieldTextValue.Equals("")) optItem.FieldTextValue = null;
    
        entries.Add(optItem.FieldTextValue);
        SpinnerValue.Tag = optItem.FieldValue;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a listView which is populated by data from an SQLite database. One
I have ListView which is saving all data to database. For adding i have
I have a listview which is populated by a SimpleCursorAdapter that is binding data
I have a listview that's populated by rows that get their data from a
In my app I have a ListView which is populated with URLs from a
I have a button in listview which is getting populated from the arrayadpater class.I
I have a ListView view I need to populate using data I am fetching
I have a ListView which is populated by a SQLite query in OnCreate using
I have an activity with a listview populated from the web. While data is
I have a simple 3-column ListView. This control is programatically populated with data from

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.