If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Retrieving value from dynamically added textbox in GridView

I have a gridview control, I have 1 column where I add textboxes where the user can enter data (not the entire column, just a few selected cells). I do this using this code in the RowDataBound event:

If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.Cells(4).Text = "xxx" Then
' this indicates where a textbox should be placed to allow the user to enter an inv or check #
Dim txtbx As New TextBox
txtbx.Visible = True
txtbx.ID = "txtRow" & e.Row.RowIndex.ToString
txtbx.Width = Unit.Pixel(75)
txtbx.BackColor = Color.LightYellow
e.Row.Cells(4).Controls.Add(txtbx)
txtbx = Nothing
End If

The textboxes are added and I am able to interact with them just fine.

My problem is when I attempt to read the value of the textboxes, I can never find them in the gridview.

I have tried using .. something like
dim txtbox as textbox
for x=0 to gridview.rows.count - 1
txtbox=gridview.rows(x).findcontrol("txtBox" & x.tostring)
next

also tried..
dim txtbox as textbox
for x=0 to gridview.rows.count - 1
txtbox=gridview.rows(x).cells(0).controls.item(0)
next

also used TryCast which always returns nothing as well.

I also just tried using the full name that the gridview gave the textbox, by looking at the source in the browser I saw it had "gridview_ctl3_txtRow1"
So I tried to loop ALL controls in the ME object to find that textbox, again it was not found.

Is it unaccessible because I added it dynamically?

Here is what a record that has been given a textbox looks like in the rendered HTML (via view source)