Reading values from textbox in template column

Discussion in 'ASP .Net Datagrid Control' started by Tim, Oct 6, 2003.

  1. Tim

    Tim Guest

    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,
     
    Tim, Oct 6, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Larry R
    Replies:
    1
    Views:
    384
    marss
    Jun 8, 2007
  2. Keith G Hicks
    Replies:
    3
    Views:
    765
    Keith G Hicks
    Feb 18, 2008
  3. Deepak

    Accessing Textbox inside a Template column using javascript

    Deepak, Aug 6, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    144
    Saravana
    Aug 6, 2003
  4. Jodi
    Replies:
    0
    Views:
    157
  5. DAC
    Replies:
    0
    Views:
    142
Loading...

Share This Page