Scrolling div with checkboxlist

Last post 08-28-2008 4:22 AM by vinz. 5 replies.

Sort Posts:

  • Scrolling div with checkboxlist

    08-27-2008, 11:57 AM
    • Member
      113 point Member
    • Cascador
    • Member since 10-12-2003, 5:00 PM
    • Posts 43

    hello,

     I'm having a problem getting a scrolling div (overflow:auto) to work in internet explorer with a checkboxlist in it.

    When the I get more items in my checkboxlist then the height of my DIV I do get the scrollbar, but the listitems extend

    down through the border of the DIV. So basically the scrollbar has no function.

    Everything works fine in firefox which makes it even more strange.

    I'm clueless now, any help is appreciated :)

     W.

    Filed under: ,
  • Re: Scrolling div with checkboxlist

    08-27-2008, 12:56 PM
    • Contributor
      2,230 point Contributor
    • cameron_w
    • Member since 04-02-2008, 8:25 AM
    • South Africa
    • Posts 334

     Use overflow:scroll instead of overflow:auto, also make sure that you set a fixed height for the div, so try: style="overflow:scroll;height:300px;width:300px;"

    Please: Don't forget to click "Mark as Answer" on the post that helped you.

    Cameron Waldron
  • Re: Scrolling div with checkboxlist

    08-28-2008, 3:10 AM
    • Member
      113 point Member
    • Cascador
    • Member since 10-12-2003, 5:00 PM
    • Posts 43

    Hello,

    thx for replying cameron, I had tried all that before. The main reason I used auto was

    to easily avoid the horizontal scrollbar. Tried overflow-y etc, no luck there too :/

    Basically this is what I get :

    scrollingDiv
     

    When I pull the scrollbar down the items don't move up.

    Everything works fine in firefox but not in IE. 

    Strange stuff :s

     

    W. 

  • Re: Scrolling div with checkboxlist

    08-28-2008, 3:37 AM
    Answer
    • All-Star
      91,768 point All-Star
    • vinz
    • Member since 10-05-2007, 11:47 AM
    • Cebu, Philippines
    • Posts 13,769
    • TrustedFriends-MVPs

    Check your CSS styles.. maybe you have set Absolute position for your CBL..

    Anyways, this works for me

    <div style="width:100px; height:50px; overflow:auto">
            <asp:CheckBoxList ID="CheckBoxList1" runat="server">
            <asp:ListItem>A</asp:ListItem>
            <asp:ListItem>B</asp:ListItem>
            <asp:ListItem>C</asp:ListItem>
            <asp:ListItem>D</asp:ListItem>
            <asp:ListItem>E</asp:ListItem>
            <asp:ListItem>F</asp:ListItem>
            </asp:CheckBoxList>
    </div>

    "Code,Beer and Music ~ my way of being a programmer"

  • Re: Scrolling div with checkboxlist

    08-28-2008, 4:15 AM
    • Member
      113 point Member
    • Cascador
    • Member since 10-12-2003, 5:00 PM
    • Posts 43

     Okay solved, I got a position relative on a parent div defined as #name table :/, apparently scrolling kept from working in IE then.

    Thx for the tip.

     W.
     

  • Re: Scrolling div with checkboxlist

    08-28-2008, 4:22 AM
    • All-Star
      91,768 point All-Star
    • vinz
    • Member since 10-05-2007, 11:47 AM
    • Cebu, Philippines
    • Posts 13,769
    • TrustedFriends-MVPs

     Great! :)

    "Code,Beer and Music ~ my way of being a programmer"

Page 1 of 1 (6 items)