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 " ;
}
}
}