starting new line in panel after inserting several linkbuttons

T

ton

Hi,

I'm adding several labels and linkbutton to a panel, without the style
attribute so these controls are next to each other.
I want to start on a new line for each 5 control, but I do not know how.

The source looks like: (it is just an example)
for i=1 to 10
if i=6 then
'how do i start on a new line ???
end if
lnk = new linkbutton
With lnk
teller = teller + 1
.ID = "filter" & teller & pnl.ID
.Text = b
.CommandArgument = 1
AddHandler .Click, AddressOf FilterLink

End With
pnl.Controls.Add(lnk)
next

Thanx

Ton
 
W

William Niver

Howdy!

For RowCounter = 0 to 10
'Create and place your button Here.
If RowCounter Mod 5 = 0 AndAlso Not RowCounter = 10 Then
'No sense popping in a BR tag if this was the last item.
pnl.Controls.Add(New LiteralControl("<BR />"))
End If
Next RowCounter

William
 
E

Eliyahu Goldin

This will work but the very idea of programmatic control over layout is
terribly wrong in ASP.NET. You should make your layout in the markup in one
of the out-of-box databound controls and setup a data source that will
populate the layout for you.


--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


William Niver said:
Howdy!

For RowCounter = 0 to 10
'Create and place your button Here.
If RowCounter Mod 5 = 0 AndAlso Not RowCounter = 10 Then
'No sense popping in a BR tag if this was the last item.
pnl.Controls.Add(New LiteralControl("<BR />"))
End If
Next RowCounter

William




__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4074 (20090514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4074 (20090514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
T

ton

thanx
It is easy and the page is very clear to the user

(I'm using it to let users define there SQL where clause as a filter for a
table.)
The combination of linkbuttons for something like [person] is null or
year([datum])=2009 and linkbuttons for AND and OR where the labels where
used for the open en closing brackets.

Now the readability is good !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top