Click here to Skip to main content
15,887,331 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
Imports System.Data
Imports System.Data.SqlClient
Partial Class MergedHeaderHeight
    Inherits System.Web.UI.Page
  



#Region "RenderHeader Enquiry Details"
    Private Sub RenderHeader(ByVal writer As System.Web.UI.HtmlTextWriter, ByVal ctl As System.Web.UI.Control)

        'We don't need to write the <TR> tag because it's already written by the writer
        'so now we write the Name column
        writer.Write("<TD align=center colspan=2 class='ghdr'>Employee</TD>")
        writer.Write("<TD align=center border=0 ROWSPAN=2 class='ghdr'>SALARY</TD>")
        writer.Write("<TD align=center colspan=2 class='ghdr'>Employee</TD>")
        writer.Write("<TD align=center border=0 ROWSPAN=2 class='ghdr'>SALARY</TD>")

        'Now we close the first row, so we can insert the second one
        writer.Write("</TR>")

        'Add the style attributes that was defined in design time
        'to our second row so they both will have the same appearance
        iFlexGrid1.HeaderStyle.AddAttributesToRender(writer)

        'Insert the second row
        writer.Write("<TR>")

        Dim iLoop As Integer
        For iLoop = 0 To ctl.Controls.Count - 1
            If iLoop = 0 Or iLoop = 1 Or iLoop = 3 Or iLoop = 4 Then
                CType(ctl.Controls.Item(iLoop), WebControl).CssClass = "ghdr"
                ctl.Controls.Item(iLoop).RenderControl(writer)
            End If
        Next
        writer.Write("</TR>")
        'We don't need to write the </TR> close tag because the writer will do that for us
        'and so we're done :)
    End Sub
#End Region

 



    Protected Sub iFlexGrid1_Load(sender As Object, e As System.EventArgs) Handles iFlexGrid1.Load
        Dim strconn = ConfigurationManager.AppSettings("Test").ToString()
        Dim sql As String = "select * from tab1"
        Dim da As New SqlDataAdapter(Sql, strconn)
        Dim dt As New DataTable()
        da.Fill(dt)
        iFlexGrid1.DataSource = dt
        iFlexGrid1.DataBind()
    End Sub

    Protected Sub iFlexGrid1_RowCreated(ByVal sender As Object, ByVal e As iInterchange.WebControls.v4.Data.iFlexGridRowEventArgs) Handles iFlexGrid1.RowCreated
        If e.Row.RowType = DataControlRowType.Header Then
            e.Row.SetRenderMethodDelegate(New RenderMethod(AddressOf RenderHeader))
        End If
    End Sub



End Class
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900