Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView w/ ITemplate Columns - Can't find data on Postback

Thread Tools

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

Posts: n/a
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

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!!
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView w/ ITemplate Columns - Can't find data on Postback John ASP .Net Web Controls 1 11-03-2008 11:37 AM
GridView ITemplate Columns Chuck P ASP .Net Web Controls 1 04-17-2007 11:41 AM
Data disappearing on postback in GridView with Dynamic columns =?Utf-8?B?dmFuZGls?= ASP .Net 2 01-25-2007 08:20 AM
Itemplate not accepting postback in data-bound templated control cosine... zero ASP .Net 0 06-09-2004 06:49 PM
Dynamically added Templated Columns (Implementing ITemplate) in DataGrid - How do I wire up events? David ASP .Net Datagrid Control 5 02-18-2004 08:28 AM