from my aspx page
place the following code
<asp:PlaceHolder ID="gridPlaceHolder" runat="server"></asp:PlaceHolder>
and the serverside codes:
Private dynamicGrids() As GridView
Private Sub getBOMComp()
Dim ds1 As New DataSet
Dim iGV As Integer = 0
Try
If SQLConnected() Then
ds1 = getBOMCompTitle()
If dsCheck(ds1) Then
dynamicGrids = New GridView(ds1.Tables(0).Rows.Count - 1) {}
For Each r As DataRow In ds1.Tables(0).Rows
Dim dynGridView As New GridView
iGV += 1
dynGridView.ID = "Gridview" + (iGV).ToString
setGVColumnsProperties(dynGridView, r("brdBomTtl").ToString)
PopulateGrids(dynGridView, r("brdBomTtl").ToString)
gridPlaceHolder.Controls.Add(dynGridView)
dynamicGrids(iGV - 1) = dynGridView
Dim literalBreak As LiteralControl = New LiteralControl("<br />")
gridPlaceHolder.Controls.Add(literalBreak)
Next
End If
End If
Catch ex As Exception
PromptError(ex.Message)
End Try
End Sub