views:

199

answers:

1

i am using VS 2005, in asp.net please tell me how can i show scroll bar in checkboxlist after the number of item count goes beyond the specified. like my situation that if their exist more then 5 items in my checkbox list than it should show a scroll bar.. and i dont want to fix its height like if their is only 1 item than it should take space of 1 item only.... please help me...

i have used this but its taking space (Hight) even their is 1 or 2 items in list.. div style="overflow-y :auto; height :100px "

+1  A: 

Instead of fixing the height with a static value, you can set the max-height of the container div. In this case it will use auto height as long as it's less than the height you specified :)

P.S. To make the max-height cross-browser compatible, you have to set it as follows in your css:

.checkBoxList {
  max-height:100px;
  height:auto !important;
  height:100px;
}
Artiom Chilaru
thanks a lot buddy.. its working as i requested..
Rajesh Rolen- DotNet Developer