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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    #1

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

    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 CreateChildCont rols)
    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.cou nt = 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
Working...