Dynamic DataGrid Columns and ViewState

J

James

I have a DataGrid control. I bind it on the initial loading of the page.
It has auto-generated columns, they aren't explicitly defined. On the bind,
I'm adding a dropdownlist to every column that's generated, in the footer
dynamically.

When I post back, I'm trying it iterate through all of the columns and
access the dropdownlists that I added dynamically. I'm having trouble doing
this because the columns collection is empty. I've seen articles on adding
this into the viewstate but I'm not sure if that's necessary. Is there a
common solution to this? Just want to make sure I'm going down the right
path.

Thanks
 

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

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,104
Latest member
LesliVqm09
Top