Form my menu, I dynamically create a breadcrumb trail in a Panel using LinkButtons and Labels. I cannot get it to wrap correctly though no matter what I do.
- Panel: Wrap=True, Width=400px, ScrollBars=None
- LinkButton: style=”white-space: nowrap”
- Label: text=”>”, so there is no whitespace
- margin-left: 5px for and inside the Panel
With LinkButton style white-space set to “nowrap”, the panel doesn’t automatically wrap the text.
Home > Chevy > Trucks > Silverado > Engineering Department > Fuel System
With LinkButton style white-space set to “normal” it wraps but not what i need.
Home > Chevy > Trucks > Silverado >
Engineering
Department >
Fuel
System
This is what I am looking for:
Home > Chevy > Trucks > Silverado >
Engineering Department > Fuel System
This is my codebehind to create the link when a menu item has been selected.
Private Sub CreateLink(name As String, id As Integer)
Dim link As LinkButton
Dim lbl As Label
link = New LinkButton
link.Text = name
link.SkinID = id
link.Style.Add("white-space", "nowrap")
AddHandler link.Click, AddressOf Links_Click
BreadCrumbPanel.Controls.Add(link)
lbl = New Label
lbl.Text = ">"
BreadCrumbPanel.Controls.Add(lbl)
End Sub
Well, I ended up setting the panel width to 100% instead of fixed with and now the result looks like below. Either result is exceptable for my needs.
Result A
Result B