copy a template column

G

Guest

This sounds complicated but bear with me. I have a datagrid. It is dynamic in
that, i dont know how many columns i will have until the dataset is back so i
have to build the datagrid dynamically. I know there will be at least one
column required however, so I have put into my aspx a template column with a
checkbox in it. Then for the number of columns in my dataset more than 1 I
want to copy that templatecolumn and duplicate it for the amount of columns
remaining in the dataset. all columns have the same checkbox in it and is
identical to the one I have written in the aspx, but the column headertext is
diff etc. the reason i do it this way is because i need to put an event in
the oncheck of the tickbox and i cannot easily dynamically set this in server
code (has to initialise before databind etc believe me i've tried).

e.g. my dataset returns 5 columns. i bind the first column to my datagrid
column 1. Then I want to duplicate this templatecolumn x 4 grabbing values of
the corresponding dataset column as I go. Does that make sense?

I cant find a way to copy a template column, and all of its child controls.

any help appreciated. 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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top