I'm trying to do just that at the moment. It's a little involved. What you
do is put everything between the <HeaderTemplate> and </HeaderTemplate> tags
(not the tags) into an .ascx file, like a user control. Then
you load that file into your template column.
http://www.dotnetbips.com/displayarticle.aspx?id=84
Trouble is, I find this method really slow. There's an alternative which is
even more complicated:
http://www.dotnetbips.com/displayarticle.aspx?id=85
Let me know if you learn a way that performs well ...
Good luck
Justin Dutoit
"Jeremy Chapman" <> wrote in message
news:#...
> At run time I've added a TemplateColumn to a DataGrid.
>
> Now I'm trying to add a Table control to the TemplateColumns's
> HeaderTemplate and ItemTemplate.
>
> In essence, I'm trying to do in code, the equilavent of this html:
>
> <asp:TemplateColumn>
>
> <HeaderTemplate>
>
> <asp:Table>
>
> <asp:TableRow>
>
> <asp:TableCell>
>
> </asp:TableRow>
>
> <asp:TableRow>
>
> <asp:TableCell>
>
> </asp:TableRow>
>
> <asp:Table>
>
> </HeaderTemplate>
>
> <ItemTemplate>
> <asp:Table>
>
> <asp:TableRow>
>
> <asp:TableCell>
>
> </asp:TableRow>
>
> <asp:TableRow>
>
> <asp:TableCell>
>
> </asp:TableRow>
>
> <asp:Table>
>
> </ItemTemplate>
>
> </asp:TemplateColumn>
>
>