Developer
Developer

Reputation: 3057

ListBox Item Width

I have a radlistbox and the items are being inserted programmatically, how do I expand the width of an item so multiple items won't show on a single line as they are showing as of now.

currently items are being inserted to listbox in c# like :

rlbAssigned.Items.Add(new RadListBoxItem(rlbAvailable.Items[rlbAvailable.SelectedIndex].Text, rlbAvailable.Items[rlbAvailable.SelectedIndex].Value));

and the listbox is declared as:

<telerik:RadListBox ID="rlbAvailable" runat="server" Height="320px" Width="200px">                                         </telerik:RadListBox>

Upvotes: 0

Views: 1195

Answers (2)

user1807534
user1807534

Reputation: 859

Never used radlistbox but seeing your other solution, looks like it acts like a normal list item.

If you only want one of them showig per line. display block should do the trick.

.RadListBox ul li       
    { 
      display:block;    
    }

Upvotes: 1

Developer
Developer

Reputation: 3057

I figured it out since it has Ul and li I resolved it using css like so:

 .RadListBox ul li       
    { 
      float: left !important;      
      width: 170px;
    }

I would be glad if someone comes up with a another solution.

Upvotes: 0

Related Questions