打印本文 打印本文 关闭窗口 关闭窗口
在ASP 中实现ASP.Net 的DataGrid 功能(转载)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3464  更新时间:2009/4/23 10:47:15  文章录入:mintao  责任编辑:mintao
bsp;          Columns.add DataSource.Fields(i).Name,DataSource.Fields(i).Name
                response.Write(DataSource.Fields(i).Name)
            Next
        end if
        
        if IsEmpty(Style) and IsEmpty(NormalStyle) then
            DefaultStyle = 1
        end if
        
        if PageSize = Empty then
            PageSize = 10
        end if
        
        select Case DefaultStyle
            Case 1
                Style                ="border=1 cellpadding=2 cellspaccing=0 borderColor=#000000 style=""Border-collapse:collapse;font-size:12px"""
                Alternate            = 1
                HeadStyle            = "Height=25 bgColor=#CCCCCC"
                AlternateStyle        = "bgColor=#EEEEEE height=20"
                NormalStyle            = "height=20"
                
            Case Else
        End Select
                
    End sub
    
    public Sub AddTemplate(ByVal ColumnName,ByVal Template)
        Columns.add ColumnName,ColumnName
        Templates.add ColumnName,Template
    End Sub

    public Sub Show()
        InitTable()
        
        Dim tableStr
        Dim tdStart,tdEnd,tbStyle,tbContent
        Dim curRow
        Dim clm
        Dim regEx,Match,Matches
           
        tableStr = "<table " & style & ">" & vbCrLF
        
        ''''Draw Table Head
        Response.Write(tableStr)
        Response.Write("<tr>")
        for Each clm in Columns.Keys()
            tbStyle = HeadStyle & " " & HeadItemStyle(clm)
            tdStart = "<td " & tbStyle & ">"
            tdEnd = "</td>"
            
            Response.Write(tdStart)
            Response.Write(Columns(clm))
            Response.Write(tdEnd)
        Next
        Response.Write("</tr>" & vbCrLF)
        
        ''''Draw Table items
        curRow = 1
        if AllowPageing &

上一页  [1] [2] [3] [4]  下一页

打印本文 打印本文 关闭窗口 关闭窗口