DataGrid Template Columns At Runtime

D

Davey P

I have a datagrid and am populating it with template columns dynamically at
runtime. I have created a class that inherits ITemplate and populates the
cells with a Drop Down List in the InstantiateIn() method. I don't have an
edit mode, basically any of the selections in drop down lists can be changed
at any time. This leaves me with the problem that on every post back I need
to save EVERY ddl's data back to my bound datatable. I placed a method in
page load to loop through all my datagrid items and save them back to my
datatable, but when my method is triggered, the column count for my datagrid
reads 0. I guess its something to do with dynamically adding columns, but am
unsure as to how to go about fixing it. Any help would be greatly appreciated.
 

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,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top