Sequence tables Table Header

Source: Internet
Author: User

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
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.