Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CheckBoxList scroll bar

Tags:

asp.net

Is there a way to let CheckBoxList to have scroll bars without using styles, Why ListBox support Rows propperty, and CheckBoxList does not support it.

Thanks

like image 429
Costa Avatar asked Jan 15 '11 12:01

Costa


2 Answers

That is not possible. You have to use a Div around with overflow:scroll.

<DIV style="OVERFLOW-Y:scroll; WIDTH:600px; HEIGHT:500px">
</DIV>
like image 167
Tim Schmelter Avatar answered Oct 12 '22 01:10

Tim Schmelter


It's not possible without using css, because a CheckBoxList is not an actual thing in HTML. It renders as a table with your checkboxes and labels in different cells.

The ListBox, however, renders as an HTML select element which has support for a size property that sets the number of rows to display before showing scroll bars.

The problem is that ASP.NET abstracts these differences away in how you deal with them on the server with its controls. As you have found, this can lead to confusing results when they render in the browser if you are not familiar with the HTML they produce.

like image 43
patmortech Avatar answered Oct 12 '22 00:10

patmortech