how to create itemtemplate in datalist
ASP.NET
2
Posts
2
Posters
0
Views
1
Watching
-
Dear all, i am using asp.net2.0 , C# i want to know how to create itemtemplate at run time. please help thanks
imran khan
-
Dear all, i am using asp.net2.0 , C# i want to know how to create itemtemplate at run time. please help thanks
imran khan
create class that implements interface System.Web.UI.ITemplate class MyItemTemplate : ITemplate { public void InstantiateIn(Control container) { // add any controls you wish into container.Controls[] collection } } TemplateField myTemplateField = new TemplateField(); myTemplateField.ItemTemplate = new MyItemTemplate(); myGridView.Columns.Add(myTemplateField); hope that helps. Pilo