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 7025847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:02:04+00:00 2026-05-28T00:02:04+00:00

Based on the value entered into an edittext I am performing a select on

  • 0

Based on the value entered into an edittext I am performing a select on a sqlite table and will need to display results from that query as

Textview EditText Button

When the button is clicked, I need to access the text value of the EditText directly to it’s left.

TableLayout tl = (TableLayout)FindViewById(Resource.Id.tl);
var connection = inst.conn();
connection.Open();
var c = connection.CreateCommand();
c.CommandText = "Select * From OnOrder Where ItemNumber = '" + contents + "'";
SqliteDataReader dr = c.ExecuteReader();

                if (dr.HasRows)
                {
                    TextView tv;
                    EditText et;
                    Button bt;
                    TableRow tr;
                    var tlp = new TableRow.LayoutParams(2);
                    var tlp2 = new TableRow.LayoutParams(3);

                    while (dr.Read())
                    {
                        tr = new TableRow(this);

                        partdesc.Text = dr[2].ToString();
                        tv = new TextView(this);
                        tv.Text = dr[0].ToString() + "   " + dr[3].ToString() + "   ";
                        tr.AddView(tv);

                        et = new EditText(this);
                        et.Hint = "Quantity";
                        et.LayoutParameters = tlp;
                        tr.AddView(et);

                        bt = new Button(this);
                        bt.LayoutParameters = tlp2;
                        bt.Text = "Receive";
                        bt.Click += delegate
                        {
                          //Don't know what to do here to make it so that when this button is clicked it acts on the values of the edittext just created to its left
                        };
                        tr.AddView(bt);

                        tl.AddView(tr);
                    }
                }

                dr.Close();
                connection.Close();

            }

Edit: Code that works

TableLayout tl = (TableLayout)FindViewById(Resource.Id.tl);
var connection = inst.conn();
connection.Open();
var c = connection.CreateCommand();
c.CommandText = "Select * From OnOrder Where ItemNumber = '" + contents + "'";
SqliteDataReader dr = c.ExecuteReader();

                if (dr.HasRows)
                {
                    TextView tv;
                    EditText et;
                    Button bt;
                    TableRow tr;
                    var tlp = new TableRow.LayoutParams(2);
                    var tlp2 = new TableRow.LayoutParams(3);
                    var cnt = 0;

                    while (dr.Read())
                    {
                        tr = new TableRow(this);
                        var record = cnt.ToString();
                        partdesc.Text = dr[2].ToString();
                        tv = new TextView(this);
                        tv.Text = dr[0].ToString() + "   " + dr[3].ToString() + "   ";
                        tr.AddView(tv);

                        et = new EditText(this);
                        et.Hint = "Quantity";
                        et.InputType = (int)Android.Text.InputTypes.ClassNumber;
                        et.LayoutParameters = tlp;
                        tr.AddView(et);

                        bt = new Button(this);
                        bt.LayoutParameters = tlp2;
                        bt.Text = "Receive";
                        bt.Click += delegate
                        {
                            getValue(Convert.ToInt32(record));

                        };
                        tr.AddView(bt);

                        tl.AddView(tr);
                        cnt++;
                    }
                }

                dr.Close();
                connection.Close();

            }
        }
    }

    public void getValue(int index)
    {
        TableLayout tl = (TableLayout)FindViewById(Resource.Id.tl);
        TableRow tr = (TableRow)tl.GetChildAt(index);
        EditText et = (EditText)tr.GetChildAt(1);
        var inst = new Inventory.invChange();
        Dialog d = inst.showBuilder(this, "Test", et.Text);
        d.Show();
    }
  • 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-05-28T00:02:04+00:00Added an answer on May 28, 2026 at 12:02 am

    Added the code I got to work. Using the delegate the way that was suggested returns a blank value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to do a search based on a term entered into a text
I'm changing a textbox (child) based on a value entered by the user into
I need to convert a number to another value based on a range: ie:
Is there a way that I can get the last value (based on the
I have an array that I want to sort based on the value of
I'm trying to style a table row based upon a value in the databound
i want to sort dictionary based upon value of each dictioanry item.but if i
Is there some inbuilt function to return weekdayname based on value 1-7? /M
I have a Dictionary<> which I want to sort based on value so I've
How can I do an if statement based on the value of a mysql

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.