Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello All,

Can someone Help Me with below problem? Just an FYI, I started WPF only 15 Days back so if any mistakes in my code, Please take it easy on me.

Below is the piece of code that i am using to dynamically add rows to a rowgroup in table element.

VB
Dim I, J As Integer
Dim DT as DataTable 'Contains atleast 10 Rows of Data
        Dim RG As New TableRowGroup
        For J = 0 To DT.Rows.Count - 1
            CRow = RG.Rows(J)
            CRow.FontSize = 12
            For I = 1 To 3
                CRow.Cells.Add(New TableCell(New Paragraph(New Run(DT.Rows(J).Item(I).ToString))))
                CRow.Cells.Add(New TableCell(New Paragraph(New Run(DT.Rows(J).Item(I).ToString))))
                CRow.Cells.Add(New TableCell(New Paragraph(New Run(DT.Rows(J).Item(I).ToString))))
            Next
        Next
        myTable.RowGroups.Add(RG)


If I Add Rows to RowGroup Statically, I see the result on report, But when I add it Dynamically, Document does not load.

Debug Fails at
VB
CRow = RG.Rows(J)
and it does not shoot any error message. Any help would be greatly appreciated.
Posted
Updated 30-Mar-13 20:09pm
v2

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