For j = 0 To ds.Tables(1).Rows.Count - 1
Dim rw As New TableRow
For k = 0 To ds.Tables(1).Columns.Count - 1
Dim cel As New TableCell
Dim txt As New TextBox
txt.ID = "cel" & j & k
txt.Text = ds.Tables(1).Rows(j).Item(k)
cel.Controls.Add(txt)
rw.Cells.Add(cel)
Next
tbl.Rows.Add(rw)
Next
i am able to populate the textboxes in the table but not able to retrieve the values from it can anyone help me out in this
thank u
thanks magaius for ur reply
but can u help in generating a new row in the table with textboxes i have tried to do it but it is generating only one row in button click
hi magius
i have table in which i have kept textboxes in every cell which acts like a flexgrid i am able to populate the the data into the textboxes and now i want a new row with textboxes when we click the add button i could able to get only one row even after we click more than once here is my code for adding a row
[code]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim i, j As Integer
For i = 1 To 1
Dim rw As New TableRow
For j = 0 To 8
Dim cel As New TableCell
Dim txt As New TextBox
txt.ID = "cel" & i & j
'txt.Text = ds.Tables(1).Rows(i).Item(j)
txt.BorderStyle = BorderStyle.Groove
txt.Style("width") = 75
cel.Controls.Add(txt)
rw.Cells.Add(cel)
Next
tbl.Rows.Add(rw)
Next
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
[\code]
You have to requery and readd every postback. If you add a row and data is saved it will show up when you reload the data. thus you only have one row that isn't stored. The new row. I'm going to post a nasty hack in a minute that gets around this.
Last edited by Magiaus; Jan 29th, 2005 at 09:42 PM.