1. regenerate the ItemCreated (required Html)
Private void maid (object sender, System. Web. UI. WebControls. DataGridItemEventArgs e)
{
If (e. Item. ItemType = ListItemType. Header)
{
E. Item. SetRenderMethodDelegate (new RenderMethod (NewRenderMethod ));
}
}
Private void NewRenderMethod (HtmlTextWriter writer, Control ctl)
{
NPTR. ICL. Command cm = new Command ();
String date = System. DateTime. Now. Date. tow.datestring ();
String week = cm. GetWeekName (date). Substring (1 );
Int wk = Convert. ToInt32 (week );
Writer. write ("<tr align = \" Center \ "style = \" color: White; background-color: SeaGreen; font-weight: bold; height: 20px; \ "> ");
Writer. write ("<td rowspan = \" 2 \ "style = \" width: 100px; \ "> Model Name </td> <td rowspan = \" 2 \ "style = \" width: 100px; \ "> Project Name </td> ");
Writer. write ("<td rowspan = \" 2 \ "style = \" width: 75px; \ "> PM </td> <td rowspan = \" 2 \ "style = \" width: 90px; \ "> watermark as watermark </td> ");
Writer. Write ("<td rowspan = \" 2 \ "style = \" width: 125px; \ "> product development segment </td> ");
For (int I = 1; I <= 4; I ++)
{
Writer. Write ("<td colspan = \" 3 \ "> W" + wk + "</td> ");
Wk ++;
}
Writer. Write ("</tr> ");
Writer. write ("<tr align = \" Center \ "valign = \" Middle \ "style = \" color: White; background-color: SeaGreen; font-weight: bold; \ "> ");
Writer. write ("<td style = \" width: 120px; \ "> calculate input date </td> <td style = \" width: 120px; \ "> inputs </td> ");
Writer. Write ("<td style = \" width: 110px; \ "> BOM Version </td> ");
Writer. Write ("<td style = \" width: 120px; \ "> scheduled input date </td> ");
Writer. Write ("<td style = \" width: 120px; \ "> quantity of inputs </td> ");
Writer. Write ("<td style = \" width: 110px; \ "> BOM Version </td> ");
Writer. Write ("<td style = \" width: 120px; \ "> scheduled input date </td> ");
Writer. Write ("<td style = \" width: 120px; \ "> quantity of inputs </td> ");
Writer. Write ("<td style = \" width: 110px; \ "> BOM Version </td> ");
Writer. Write ("<td style = \" width: 120px; \ "> scheduled input date </td> ");
Writer. Write ("<td style = \" width: 120px; \ "> quantity of inputs </td> ");
Writer. Write ("<td style = \" width: 110px; \ "> BOM Version </td> ");
Writer. Write ("</tr> ");
}
Bytes -------------------------------------------------------------------------------------------------------------------------------
2.Re-generate the ItemCreated time (Control can add TalbeCell or Table)
Private void Datagrid_105_ItemCreated (object sender, System. Web. UI. WebControls. DataGridItemEventArgs e)
{
# Region Build DataGrid headers 105
ListItemType ItemType = e. Item. ItemType;
If (ItemType = ListItemType. Pager)
{
If (upPager105)
{
TableCell CellGR105 = (TableCell) e. Item. Controls [0];
CellGR105.Controls. Clear ();
CellGR105.BackColor = Color. FromName ("#009F62 ");
CellGR105.ForeColor = System. Drawing. Color. LightYellow;
CellGR105.ColumnSpan = 2;
CellGR105.HorizontalAlign = HorizontalAlign. Center;
CellGR105.Controls. Add (new LiteralControl ("GR 105 (original material release )"));
E. Item. Controls. Add (CellGR105 );
UpPager105 = false;
}
}
# Endregion
}