zoukankan      html  css  js  c++  java
  • DataGrid表头跨行合并的实现

        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 = "序号"
                tcl.Add(New TableHeaderCell)
                tcl(1).RowSpan = 2
                tcl(1).Text = "项目名称"
                tcl.Add(New TableHeaderCell)
                tcl(2).RowSpan = 2
                tcl(2).Text = "总投资"
                tcl.Add(New TableHeaderCell)
                tcl(3).RowSpan = 2
                tcl(3).Text = "至上年底累计实际完成投资"
                tcl.Add(New TableHeaderCell)
                tcl(4).RowSpan = 2
                tcl(4).Text = "当年计划完成投资"
                tcl.Add(New TableHeaderCell)
                tcl(5).ColumnSpan = 4
                tcl(5).Text = DataTime.Now.Year() & "年1-" & DataTime.Now.Month() & "月</th></tr><tr><th>完成<br>投资</th><th>占年计<br>划(%)</th><th>资金<br>到位</th><th>占年计<br>划(%)"
                tcl(5).Attributes.Add("BackColor", "#006699")
                'tcl(5).BackColor = "#006699"
            End If
        End Sub
    效果图
  • 相关阅读:
    python前端之css
    前端开发
    python前端开发工具篇
    python数据结构和算法2 顺序表和链表
    python数据结构和算法3 栈、队列和排序
    python数据结构和算法 二叉树
    python数据结构和算法1
    python18天-pycharm & 正则表达式
    Head First Servlets & JSP 学习笔记 第五章 —— 作为Web应用
    Head First Servlets & JSP 学习笔记 第四章 —— 作为Servlet
  • 原文地址:https://www.cnblogs.com/qiao198/p/200199.html
Copyright © 2011-2022 走看看