array of textboxes- dynamic controls

B

begin22

Hey,

I am using the MultiView control to create a Wizard style web app. At
some point in the Wizard I need the user to input 2 values which
correspond to rows and columns. On the next step in the Wizard i
proceed to create and put in a View rows*columns textboxes. Here is
some of my code:

Global declaration: public TextBox[] textBoxBarCodes;

Code to write the textboxes to the view:
textBoxBarCodes = new TextBox[numRows * numCols];

int k = 0;
for (int j = 0; j < numRows; j++)
{
TableRow r = new TableRow();
for (int i = 0; i < numCols; i++)
{
TableCell c = new TableCell();
textBoxBarCodes = new TextBox();
textBoxBarCodes.ID = k.ToString();
c.Controls.Add(textBoxBarCodes);
r.Cells.Add(c);
++k;
}
tableView1.Rows.Add(r);
}

this.View1.Controls.Add(tableBarCodes);



Now my problem is that I can't reference back to the array of
textboxes. I know that I should be recreating each time on page init,
but I am unlcear how to do that in terms of the Wizard (i.e I only
know how many textboxes I need after several initial postbacks).

If someone could point me in the right direction that would be VERY
much appreciated.

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top