System.Web.UI.WebControls.TemplateColumn cl=new TemplateColumn ();
我要在ItemTemplate里增加一个Label
在.EditItemTemplate 增加一个ComboBox,
cl.ItemTemplate=?
cl..EditItemTemplate=?
我这些是在后台动态创建的列
我要在ItemTemplate里增加一个Label
在.EditItemTemplate 增加一个ComboBox,
cl.ItemTemplate=?
cl..EditItemTemplate=?
我这些是在后台动态创建的列
{
#region ITemplate 成员
public void InstantiateIn(Control container)
{
CheckBox cb = new CheckBox();
cb.Attributes.Add( "onclick", "DoSL(this)" );
container.Controls.Add( cb );
}
#endregion }
protected override void OnInit(EventArgs e)
{
if( _enableCheckBox )
{
TemplateColumn col = new TemplateColumn();
col.ItemTemplate = new CheckBoxColumnTemplate();
this.Columns.AddAt( 0, col );
this.Columns[0].HeaderStyle.Width = Unit.Pixel(20);
} base.OnInit (e);
}参考一下