Implementation of cross-row merge of DataGrid Headers

Source: Internet
Author: User
Private sub datagrid_itemcreated (byval sender as object, byval e as system. Web. UI. webcontrols. datagriditemeventargs) handles DataGrid. itemcreated
If E. Item. itemtype = listitemtype. header then
Dim datatime as datetime = new datetime
Dim TCl as tablecellcollection = E. Item. Cells
TCL. Clear ()
TCL. Add (New tableheadercell)
TCL (0). rowspan = 2
TCL (0). Text = "no"
TCL. Add (New tableheadercell)
TCL (1). rowspan = 2
TCL (1). Text = "project name"
TCL. Add (New tableheadercell)
TCL (2). rowspan = 2
TCL (2). Text = "Total Investment"
TCL. Add (New tableheadercell)
TCL (3). rowspan = 2
TCL (3). Text = "actual investment completed at the end of last year"
TCL. Add (New tableheadercell)
TCL (4). rowspan = 2
TCL (4). Text = "planned investments in the current year"
TCL. Add (New tableheadercell)
TCL (5). columnspan = 4
TCL (5 ). TEXT = datatime. now. year () & "Year 1-" & datatime. now. month () & amp; "month </Th> </tr> <TH> completed <br> Investment </Th> <TH> annual share <br> (%) </Th> <TH> funds <br> in place </Th> <TH> annual share <br> (% )"
TCL (5). Attributes. Add ("backcolor", "#006699 ")
'The TCL (5). backcolor = "#006699"
End if
End sub

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.