User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 392,083 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,943 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 3918 | Replies: 1
Reply
Join Date: Mar 2007
Posts: 34
Reputation: shy_wani is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
shy_wani shy_wani is offline Offline
Light Poster

Create control at runtime

  #1  
May 1st, 2007
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~
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Posts: 11
Reputation: jabijohn is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 1
jabijohn jabijohn is offline Offline
Newbie Poster

Re: Create control at runtime

  #2  
May 2nd, 2007
Originally Posted by shy_wani View Post
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"
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ASP.NET Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 12:25 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC