Reading values from textbox in template column

T

Tim

Hello,

I have an aspx page that presents two datagrids to the user. These
datagrids contain 2 bound columns that are populated from an Oracel db
when the grid is bound. It also contains three template columns that
have textboxes defined in the itemtemplate section so that they appear
for every line in the grid.

The users can enter numbers in these textboxes and then hit "next
screen" at the bottom of the page. When this happens I need to be able
to read these values and store them in session variables.

I am using this code to read the values in the next screen click
event:
---------------------------------------------------
For Each dgItem In DataGrid1.Items
strdata = dgitem.Cells(0).Text
strdata += dgItem.Cells(1).Text & "~"
strdata += CType(dgItem.FindControl("lbldesc1"), Label).Text & "~"
strdata += CType(dgItem.FindControl("grd1_qty_ord"), TextBox).Text &
"~"
next
----------------------------------------------------

Values are returned for the first three items because this data is
loaded during the bind. But it always returns nothing for the textbox
even if I put data in it.

Do I need to somehow save this data the user enters in the datagrid?
I can't re-bind the datagrid as that will erase what is in the
textboxes.

Thanks,
 

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,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top