jamie_pattison
Well-known member
- Joined
- Sep 9, 2008
- Messages
- 116
- Programming Experience
- Beginner
I have a function with an array, where i am trying to set the header text in a dynamically created table.
This doesnt seem to display any of the values contained in the array, yet if i change the line
thc.Text = hdr
to
thc.Text = Header
it displays a value in the header (in other words the code executes as expected and create table headers)? I cant figure out why the array doesnt work in the same manner?
thanks
VB.NET:
Dim Headers() As String={"One", "Two", "Three"}
For Header As Integer = 1 To 3
thc = New TableHeaderCell
For Each hdr As String In Headers
thc.Text = hdr
Next
thr.Cells.Add(thc)
tbl.Rows.Add(thr)
Next
This doesnt seem to display any of the values contained in the array, yet if i change the line
thc.Text = hdr
to
thc.Text = Header
it displays a value in the header (in other words the code executes as expected and create table headers)? I cant figure out why the array doesnt work in the same manner?
thanks