Recently the project used the dynamic loading template repeater, found in the garden to find A: http://www.cnblogs.com/xingshao/archive/2010/08/06/1793827.html
For reference, modify it to what you need. In this record.
Public class mytemplate: itemplate
{List <string> mylist; Public mytemplate (repeater RPT, list <string> List) {mylist = List; Rpt. itemdatabound + = new round (rep_itemdatabound);} public void instantiatein (control container) {htmlgenericcontrol TR = new htmlgenericcontrol ("TR"); checkbox chk = new checkbox (); chk. id = "Chk"; htmlgenericcontrol TD1 = new htmlgenericcontrol ("TD"); td1.controls. add (chk); tr. controls. add (TD1); htmlgenericcontrol td2; foreach (var str in mylist) {literal LBL = new literal (); LBL. TEXT = STR; LBL. id = "LBL _" + STR; td2 = new htmlgenericcontrol ("TD"); td2.controls. add (LBL); tr. controls. add (td2);} container. controls. add (TR);} void rep_itemdatabound (Object sender, repeateritemeventargs e) {foreach (var str in mylist) {literal LBL = (literal) E. item. findcontrol ("LBL _" + Str); LBL. TEXT = databinder. eval (repeateritem) LBL. namingcontainer ). dataitem, LBL. text ). tostring ();}}}
Background call:
Repwolist. itemtemplate = new mytemplate (repwolist, listtemp );
Repwolist. datasource = List; repwolist. databind ();