Link to home
Start Free TrialLog in
Avatar of Gezna
Gezna

asked on

Placeholder new line

I'm using a placeholder to hold rows of controls (textboxes and dropdownlists) and I'm looking for a way to add them so that I get eleven columns in each row.

My problem is now that if the controls don't take up the entire width of the page, then a control that I intended to go on the row below ends up on the row above.

To resolve the problem I am currently adding an invisible label to take up the rest of the space in the row, but is there some way to push the control down to the next line?

Thanks

ASKER CERTIFIED SOLUTION
Avatar of roverm
roverm
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or place all controls inside a table. Then you can use <TR></TR> to define your rows.
Avatar of preeth
preeth

Hope this works for u,

For intCounter = 0 To l_dtDtattable.Rows.Count - 1 'ViewState("ProductFieldCount")
                Dim ll As Integer
                ll = intCounter

                Dim litLabel As System.Web.UI.LiteralControl
                Dim txtTextBox As System.Web.UI.WebControls.TextBox
                Dim radRadiolist As System.Web.UI.WebControls.RadioButtonList

                'add textbox control
                txtTextBox = New System.Web.UI.WebControls.TextBox()
                txtTextBox.ID = Trim(l_dtDtattable.Rows(ll).Item("QID"))
                txtTextBox.Text = Trim(l_dtDtattable.Rows(ll).Item("QID"))
                txtTextBox.Width = System.Web.UI.WebControls.Unit.Pixel(40)
                'txt_qid1.Width = System.Web.UI.WebControls.Unit.Pixel(60)
                Me.PlaceHolder1.Controls.Add(txtTextBox)

                'add literal Controls
                litLabel = New System.Web.UI.LiteralControl()
                litLabel.Text = "<b> " & l_dtDtattable.Rows(ll).Item("Questionn") & ":</b>"
                Me.PlaceHolder1.Controls.Add(litLabel)

                'add  Radiolist controls
                radRadiolist = New System.Web.UI.WebControls.RadioButtonList()
                radRadiolist.ID = "rad" & Trim(l_dtDtattable.Rows(ll).Item("QID"))
                radRadiolist.Items.Add(l_dtDtattable.Rows(ll).Item("Choice_1"))
                radRadiolist.Items.Add(l_dtDtattable.Rows(ll).Item("Choice_2"))
                radRadiolist.Items.Add(l_dtDtattable.Rows(ll).Item("Choice_3"))
                radRadiolist.Items.Add(l_dtDtattable.Rows(ll).Item("Choice_4"))
                Me.PlaceHolder1.Controls.Add(radRadiolist)
            Next