zoukankan      html  css  js  c++  java
  • DataGrid复杂表头的制作

          Private Sub DataGrid1_ItemCreated(ByVal sender As ObjectByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemCreated
            
    If e.Item.ItemType = ListItemType.Header Then
                e.Item.Cells(
    0).RowSpan = 2
                e.Item.Cells(
    1).RowSpan = 2
                e.Item.Cells(
    2).RowSpan = 2
                e.Item.Cells(
    3).ColumnSpan = 12
                e.Item.Cells(
    3).HorizontalAlign = HorizontalAlign.Center
                
    Dim TmpTd As String = "尺   码</td><td RowSpan = 2>总数</td> </tr>"
                TmpTd = TmpTd & "<tr><td  class=""Headstyle""  align=""center"" valign=""top"">24<br>99</td> 
    <td class=""Headstyle""  align=""center"" valign=""top"">25</td>"

                TmpTd = TmpTd & "<td class=""Headstyle""  align=""center"" valign=""top"">26<br>XS</td>  
    <td class=""Headstyle""  align=""center"" valign=""top"">27<br>S</td>"

                TmpTd = TmpTd & " <td class=""Headstyle""  align=""center"" valign=""top"">28<br>M</td>
    <td class=""Headstyle""  align=""center"" valign=""top"">29<br>L</td>"

                TmpTd = TmpTd & "<td class=""Headstyle""  align=""center"" valign=""top"">30<br>XL</td>
    <td class=""Headstyle""  align=""center"" valign=""top"">31<br> XXL</td>"

                TmpTd = TmpTd & "<td class=""Headstyle""  align=""center"" valign=""top"">32</td>
    <td class=""Headstyle""  align=""center"" valign=""top"">34</td>"

                TmpTd = TmpTd & "<td class=""Headstyle""  align=""center"" valign=""top"">36</td>
    <td class=""Headstyle""  align=""center"" valign=""top"">38</td></tr><tr><td>"

                e.Item.Cells(3).Text = TmpTd
                e.Item.Cells(
    4).Visible = False
                e.Item.Cells(
    5).Visible = False
                e.Item.Cells(
    6).Visible = False
                e.Item.Cells(
    7).Visible = False
                e.Item.Cells(
    8).Visible = False
                e.Item.Cells(
    9).Visible = False
                e.Item.Cells(
    10).Visible = False
                e.Item.Cells(
    11).Visible = False
                e.Item.Cells(
    12).Visible = False
                e.Item.Cells(
    13).Visible = False
                e.Item.Cells(
    14).Visible = False
                e.Item.Cells(
    15).Visible = False

            
    End If

    demo img Url: http://myx.name/demo/demoimg/GridHead.jpg 
  • 相关阅读:
    trailRenderer
    通过sysobjects快速查找SQLServer中是否有某个表、视图、存储过程等对象实操
    浅谈信息系统(IT)项目管理-序幕
    使用open xml 判断sharepoint文档是否损坏
    Sharepoint the file is locked for use domainuser edit.文件被锁定,解锁方式
    sharepoint 列表库指定序号规则
    Biztalk 宏
    Biztalk 在流程中定义将消息保存为文件的文件名
    Biztalk 2013 新特性简介(英)
    devexpress gridview,selectedrowchanged
  • 原文地址:https://www.cnblogs.com/myx/p/37934.html
Copyright © 2011-2022 走看看