G
Guest
Hi there, I cannot write a datagrid on the aspx because i do not know the
names of the column headings until i run a query. So i have to do it
programatically from the datasource.
I have managed to add a couple of boundcolumns based on my datasource easy
peasy but can't find any help anywhere to show me how to dynamically set up
the itemtemplate within a templatecolumn (and add say a checkbox to it). So
what goes after this? I know the syntax is wrong in the following but I cant
find anything close to this in the properties or methods of templatecolumn.
I read another post saying 'new columnTemplate' but cant find this class
anywhere..
TemplateColumn tc = new TemplateColumn();
//want to do the following
ItemTemplate it = new ItemTemplate()
it.Controls.Add(a Checkbox)
tc.Controls.Add(it)
names of the column headings until i run a query. So i have to do it
programatically from the datasource.
I have managed to add a couple of boundcolumns based on my datasource easy
peasy but can't find any help anywhere to show me how to dynamically set up
the itemtemplate within a templatecolumn (and add say a checkbox to it). So
what goes after this? I know the syntax is wrong in the following but I cant
find anything close to this in the properties or methods of templatecolumn.
I read another post saying 'new columnTemplate' but cant find this class
anywhere..
TemplateColumn tc = new TemplateColumn();
//want to do the following
ItemTemplate it = new ItemTemplate()
it.Controls.Add(a Checkbox)
tc.Controls.Add(it)