Hi, i'm having this problem, although the above doesnt seem to work for me. Please see my code below, its a website not a windows app by the way. I've cut out a chunk of the method to make it shorter.
Protected Sub MakeTable()
If level = 2 Then
Dim UpdateButton As New Button
UpdateButton.Text = "Edit"
UpdateButton.ID = "BtnUpdate" & row.Item("ID")
UpdateButton.CommandArgument = row.Item("ID")
AddHandler UpdateButton.Click, AddressOf EditBtn_Click
tc.Controls.Add(UpdateButton)
End If
End If
trtwo.Controls.Add(tc)
Next i
tbl.Controls.Add(trtwo)
Next
SearchArea.Controls.Add(tbl)
End Sub
Protected Sub MakeTable()
If level = 2 Then
Dim UpdateButton As New Button
UpdateButton.Text = "Edit"
UpdateButton.ID = "BtnUpdate" & row.Item("ID")
UpdateButton.CommandArgument = row.Item("ID")
AddHandler UpdateButton.Click, AddressOf EditBtn_Click
tc.Controls.Add(UpdateButton)
End If
End If
trtwo.Controls.Add(tc)
Next i
tbl.Controls.Add(trtwo)
Next
SearchArea.Controls.Add(tbl)
End Sub