GridView w/ ITemplate Columns - Can't find data on Postback

Discussion in 'ASP .Net' started by John, Oct 31, 2008.

  1. John

    John Guest

    I'm dynamically creating all the Columns in a GridView at run time and
    binding it to a DataTable. I have to build it at runtime (using an
    ITemplate subclass) because the number of columns is based on User
    input. All column cells are rendered as Textboxes. All Textboxs & the
    Grid have EnableViewState = True;

    Everything works fine except on Postback I can't seem to find the
    embeded Textbox controls that are needed to determine what the user
    has changed and be able to update the underlying Data table. Do
    Dynamically rendered controls come back in Viewstate???? They must,
    but I can't find them.

    on Page_Load (if it is a Postback) I build/rebuild the GridViews
    columns (I also tried in CreateChildControls)
    I do not bind the Data here because any user changes would be
    overwritten

    in Page_PreRender I try to Access the rows of the GridView but
    MyGrid.Rows.count = 0
    My intent is to update the DataTable with any cahnges and then Rebind

    Where can I access the Data the user entered on the Page?

    Thanks for any help!!
    -John
     
    John, Oct 31, 2008
    #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. cosine... zero
    Replies:
    0
    Views:
    676
    cosine... zero
    Jun 9, 2004
  2. Luhar Powell via .NET 247
    Replies:
    0
    Views:
    2,460
    Luhar Powell via .NET 247
    Apr 1, 2005
  3. David
    Replies:
    5
    Views:
    280
    Jeffrey Tan[MSFT]
    Feb 18, 2004
  4. Chuck P

    GridView ITemplate Columns

    Chuck P, Apr 16, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    214
    Steven Cheng[MSFT]
    Apr 17, 2007
  5. John
    Replies:
    1
    Views:
    181
    myles
    Nov 3, 2008
Loading...

Share This Page