|
-
Oct 21st, 2004, 08:52 AM
#1
Thread Starter
Member
Dynamic generation of CheckBoxes
Hi everyone
I am trying to generate Checkboxes at runtime...its basically a order form, where number of checkboxes will depend on number of items in the form..and the items will be picked from database.
i dont know if thats right...but i tried using Controls.Add( New Checkbox)...i could solve the issue with this.
Can anyone kindly help me out.
regds
yash.
-
Oct 22nd, 2004, 03:42 PM
#2
Member
When I dynamically add controls, usually I use a htmltable as a container and add a new row and cell and then add the control to that cells control collection.
Maybe if you'd stop breathing and die for a change I wouldn't be so pissed off all the time.
www.mredkj.com
-
Oct 23rd, 2004, 02:38 AM
#3
Thread Starter
Member
.may you please send me the code for generating the checkboxes dynamically..
-
Oct 25th, 2004, 01:59 AM
#4
Thread Starter
Member
still waiting for a response from anyone...
i m trying to generate checkboxes dynamically through COdeBehind...is this possible...plz reply
-
Oct 26th, 2004, 09:29 AM
#5
Member
This is the basics of it.
'create Table Row
Dim htmlRow As New system.Web.UI.HtmlControls.HtmlTableRow
htmlRow.ID = "UniqueID"
'create Table Cell
Dim htmlcell As New System.Web.UI.HtmlControls.HtmlTableCell
htmlcell.Align = "left"
'Create CheckBox
Dim chk As New System.Web.UI.WebControls.CheckBox
chk.ID = "UniqueCheckBoxID"
'add checkbox to cell and then the cell to the row
htmlcell.Controls.Add(chk)
htmlRow.Controls.Add(htmlcell)
'find the table to add to
htmlTable = Me.FindControl("TABLEName")
'add row to table
htmlTable.Controls.Add(htmlRow)
Maybe if you'd stop breathing and die for a change I wouldn't be so pissed off all the time.
www.mredkj.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|