all groups > asp.net webcontrols > june 2004 >
You're in the

asp.net webcontrols

group:

Create TemplateColumn Dynamically


Create TemplateColumn Dynamically Lubos
6/30/2004 8:51:21 AM
asp.net webcontrols:
Hi,
I'd like to create TemplateColumn at runtime.
I want to add an Control (like Button,..) to this column.
Is there any example how to this this?

Thanks in advance,
Lubos

PS:
I can do this with the BountColumn:
BoundColumn bc2 = new BoundColumn();
bc2.DataField = "product_nm";
bc2.HeaderText = "Number";
Re: Create TemplateColumn Dynamically Teemu Keiski
6/30/2004 11:13:04 PM
Hi,

you'd need to create templates

a) by loading them from user control files (Page.LoadTemplate method)
or
b) create templates by having classes that implement ITemplate interface.
See an article about it here:
http://www.tripleasp.net/tutorial.aspx?NavID=27

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke



[quoted text, click to view]

AddThis Social Bookmark Button