954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Create control at runtime

i've got this code to create control at runtime..
the problem is that i've forgotten the link and i can't refer to its documentation....
the problem is...i don't understand this line:
Dim parent As String = CStr(ds.Tables(1).Rows(0)("Parent"))

what does this parent refer to?

Dim options As New RadioButtonList
For Each row As DataRow In ds.Tables(0).Rows
Dim item As New ListItem
item.Text = CStr(row("Name"))
item.Value = CStr(row("Id"))
options.Items.Add(item)
Next
Dim parent As String = CStr(ds.Tables(1).Rows(0)("Parent"))
Select Case parent
Case "sideNav"
columnSidenav.Controls.Add(options)
Case "footer"
footerCoontainer.Controls.add(options)
Case Else
paceholderDefault.Controls.add(options)
End Select


~i wanted to learn more~

shy_wani
Light Poster
34 posts since Mar 2007
Reputation Points: 10
Solved Threads: 0
 

i've got this code to create control at runtime.. the problem is that i've forgotten the link and i can't refer to its documentation.... the problem is...i don't understand this line: Dim parent As String = CStr(ds.Tables(1).Rows(0)("Parent"))

what does this parent refer to?

Dim options As New RadioButtonList
For Each row As DataRow In ds.Tables(0).Rows
Dim item As New ListItem
item.Text = CStr(row("Name"))
item.Value = CStr(row("Id"))
options.Items.Add(item)
Next
Dim parent As String = CStr(ds.Tables(1).Rows(0)("Parent"))
Select Case parent
Case "sideNav"
columnSidenav.Controls.Add(options)
Case "footer"
footerCoontainer.Controls.add(options)
Case Else
paceholderDefault.Controls.add(options)
End Select

~i wanted to learn more~


"parent" is the column name in that specific context, the line is going to return the 1st row parent column value to "string var"

jabijohn
Newbie Poster
11 posts since Oct 2006
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You