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
That is not possible. You have to use a Div around with overflow:scroll.
<DIV style="OVERFLOW-Y:scroll; WIDTH:600px; HEIGHT:500px">
</DIV>
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.
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