Dynamically created Datagrid not found on postback

J

Jeff User

Hi all
I need to create datagris dynamically in C# code.
I placed a PlaceHolder object on my form and then as Datagrids are
created, they are added to the PlaceHolder. This works and display
well but on postback, my PlaceHolder object has no controls.i.e.
PlaceHolder1.Controls.Count is 0
I can determine the IDs of the grids created which allows me to use
FindControl, but FindControl also does not find them.

One of the columns in the grids is a textbox that the user fills in a
number. I need to capture this number (if entered).

Some article state that the controls need to be re-created on
postback. How do I do this, without losing the values that the user
filled in? When I recreate the same grid controls again, the new text
boxes are empty (of course).
Thanks
Jeff
 

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,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top