Hi,
The following code generates a (html)tabel with three cells and an ammount of columns wihich is specified in a textbox that should be filled in by a user (the user gives the ammount of collumns clicks a "button" and the collumn with the desired ammoun of rows is "drawn".
Dim i As Integer
For i = 1 To CType(txtAmountDelivered.Text, Integer)
Dim row As New HtmlTableRow
Dim ddlArt As New DropDownList
'items come later out of a db
ddlArt.Items.Add("artikel1")
ddlArt.Items.Add("artikel2")
ddlArt.Items.Add("artikel3")
ddlArt.Items.Add("artikel4")
'etc...
Dim txttest As New TextBox
txttest.Font.Name = "verdana"
txttest.Font.Size = txttest.Font.Size.XXSmall
txttest.Text = "Amount"
Dim cel1 As New HtmlTableCell
Dim cel2 As New HtmlTableCell
Dim cel3 As New HtmlTableCell
Dim lblArtOmschrijving As New Label
lblArtdescription.Text = "--from afas DB--" 'changes later depending on what is chosen out of the dropdowlist (which is generated)
'cel1.InnerText = "test"
'cel2.InnerText = "test"
'cel3.Controls.Add(txttest)
cel1.Controls.Add(ddlArt)
cel2.Controls.Add(lblArtOmschrijving)
cel3.Controls.Add(txttest)
row.Cells.Add(cel1)
row.Cells.Add(cel2)
row.Cells.Add(cel3)
tbl_Delivered.Rows.Add(row)
next
This works perfectly but:
cell1 contains a dropdownlist with values coming out of an sqlDB
My question: How can I acces the generated controls (dropdownlists) if they don't even "exist" the first time the app. is runned.
so: how can I fire the selectedIndexChanged event from the generated controls
thanx in advance
K.
The following code generates a (html)tabel with three cells and an ammount of columns wihich is specified in a textbox that should be filled in by a user (the user gives the ammount of collumns clicks a "button" and the collumn with the desired ammoun of rows is "drawn".
Dim i As Integer
For i = 1 To CType(txtAmountDelivered.Text, Integer)
Dim row As New HtmlTableRow
Dim ddlArt As New DropDownList
'items come later out of a db
ddlArt.Items.Add("artikel1")
ddlArt.Items.Add("artikel2")
ddlArt.Items.Add("artikel3")
ddlArt.Items.Add("artikel4")
'etc...
Dim txttest As New TextBox
txttest.Font.Name = "verdana"
txttest.Font.Size = txttest.Font.Size.XXSmall
txttest.Text = "Amount"
Dim cel1 As New HtmlTableCell
Dim cel2 As New HtmlTableCell
Dim cel3 As New HtmlTableCell
Dim lblArtOmschrijving As New Label
lblArtdescription.Text = "--from afas DB--" 'changes later depending on what is chosen out of the dropdowlist (which is generated)
'cel1.InnerText = "test"
'cel2.InnerText = "test"
'cel3.Controls.Add(txttest)
cel1.Controls.Add(ddlArt)
cel2.Controls.Add(lblArtOmschrijving)
cel3.Controls.Add(txttest)
row.Cells.Add(cel1)
row.Cells.Add(cel2)
row.Cells.Add(cel3)
tbl_Delivered.Rows.Add(row)
next
This works perfectly but:
cell1 contains a dropdownlist with values coming out of an sqlDB
My question: How can I acces the generated controls (dropdownlists) if they don't even "exist" the first time the app. is runned.
so: how can I fire the selectedIndexChanged event from the generated controls
thanx in advance
K.