protected override void OnInit(EventArgs e)
{
rcbCustomer.HeaderTemplate = new HeaderTemplate();
rcbCustomer.ItemTemplate = new HeaderItemTemplate();
base.OnInit(e);
}
{
}
public class HeaderTemplate : ITemplate
{
public void InstantiateIn(Control container)
{
HtmlTable table = new HtmlTable();
HtmlTableRow row = new HtmlTableRow();
HtmlTableCell cell = new HtmlTableCell();
cell.InnerText = "客户编号";
cell.Width = Unit.Pixel(100).ToString();
row.Controls.Add(cell);
HtmlTableCell cell1 = new HtmlTableCell();
cell1.InnerText = "客户名称";
cell1.Width = Unit.Pixel(160).ToString();
row.Controls.Add(cell1);
HtmlTableCell cell2 = new HtmlTableCell();
cell2.InnerText = "主联系人";
cell2.Width = Unit.Pixel(100).ToString();
row.Controls.Add(cell2);
HtmlTableCell cell3 = new HtmlTableCell();
cell3.InnerText = "类型";
cell3.Width = Unit.Pixel(100).ToString();
row.Controls.Add(cell3);
HtmlTableCell cell4 = new HtmlTableCell();
cell4.InnerText = "商务人员";
cell3.Width = Unit.Pixel(90).ToString();
row.Controls.Add(cell4);
table.Controls.Add(row);
container.Controls.Add(table);
}
}