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

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top