I have this and it shows all of the items in the listbox but there are alot of them
<label for=”Application”>Application:</label>
<%= Html.ListBox("SelectedCategories", Model.Applications)%>
is there a way to show just show 5 items and add a scrollbar (compared to increasing the height of the listbox)
Step 2: Drag the ListBox control from the ToolBox and drop it on the windows form. You are allowed to place a ListBox control anywhere on the windows form according to your need. Step 3: After drag and drop you will go to the properties of the ListBox control to set the size of the ListBox.
Use the Count property to determine the number of selected items in the ListBox.
You could set the "size" attribute on the select element to 5. Like this:
<%= Html.ListBox("SelectedCategories", Model.Applications, new {size=5})%>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With