Gridview double-layer Header

Source: Internet
Author: User

The main idea of implementing a double-layer header in the gridview is to rewrite the header using the rowcreated method of the gridview.

The implementation is as follows:

Nprb table ticket & basic information | export date | actual export date | delay difference daily data

Bytes ---------------------------------------------------------------------------------------------
Nprb_no | Bu | Pm | model_name | design_pln | design_act | design_del

CodeAs follows:

 

Code

Protected   Void Gdvreport_rowcreated ( Object Sender, gridviewroweventargs E)
{
If (E. Row. rowtype = Datacontrolrowtype. header)
{
Tablecellcollection TCL = E. Row. cells;
TCL. Clear ();
TCL. Add ( New Tableheadercell ());
TCL [ 0 ]. Columnspan =   4 ; // Merge Columns
TCL [ 0 ]. Text =   " Nprb table ticket & Basic Information " ;

TCL. add ( New tableheadercell ());
TCL [ 1 ]. text = " metric date " ;

TCL. Add (NewTableheadercell ());
TCL [2]. Text= "Actual expiration date";

TCL. Add ( New Tableheadercell ());
TCL [ 3 ]. Text =   " Delay Differential daily data </Th> </tr> <tr> " ; // The first layer has been written. below is the second layer.

TCL. Add ( New Tableheadercell ());
TCL [ 4 ]. Text =   " Nprb_no " ;
TCL. Add ( New Tableheadercell ());
TCL [ 5 ]. Text =   " Bu " ;
TCL. Add ( New Tableheadercell ());
TCL [ 6 ]. Text =   " PM " ;
TCL. Add ( New Tableheadercell ());
TCL [ 7 ]. Text =   " Model_name " ;

TCL. add ( New tableheadercell ());
TCL [ 8 ]. text = This . ddlphase. selectedvalue + " _ PLN " ;

TCL. Add (NewTableheadercell ());
TCL [9]. Text= This. Ddlphase. selectedvalue+ "_ Act";

TCL. Add ( New Tableheadercell ());
TCL [ 10 ]. Text =   This . Ddlphase. selectedvalue +   " _ Del " ;
}
}
}

 

 

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.