Public Sub bind()
Dim dt As DataTable = New DataTable()
Dim dc As DataColumn = New DataColumn("ID", GetType(Int32))
Dim dc2 As DataColumn = New DataColumn("Col2", GetType(String))
Dim dc3 As DataColumn = New DataColumn("Col3", GetType(String))
Dim dc4 As DataColumn = New DataColumn("Col4", GetType(String))
dt.Columns.Add(dc)
dt.Columns.Add(dc2)
dt.Columns.Add(dc3)
dt.Columns.Add(dc4)
For i As Integer = 0 To txtNumRows.text - 1
Dim dr As DataRow = dt.NewRow()
dr("ID") = i+1
dr("Col2") = ""
dr("Col3") = ""
dr("Col4") = ""
dt.Rows.Add(dr)
Next
GridView1.DataSource = dt
GridView1.DataBind()
End Sub