tags:

views:

473

answers:

2

How to hide the vertical scroll bar of a Listbox that is present inside a div.

<div id="lstQueriesDiv" style="overflow-y: hidden !important; overflow-x: auto !important;
         Width: 650px; height:167px;" > 
 <asp:ListBox ID="lstQueries" runat="server" CssClass="cssLstQueries" Rows="9"></asp:ListBox>
</div>

css:

    .cssLstQueries{
    Width:auto;
    }

I want to hide the vertical scrollbar of the listbox not the the vertical scrollbar of the div.

+1  A: 

set the scrollbars in your object properties

Digital Human
i tried but there's no properties for the scrollbar.
Codeffect
+1  A: 

remove OVERFLOW:auto; from

<div id="lstQueriesDiv" style="OVERFLOW:auto; Width: 650px; height:167px;" > 

becouse it overwriting the css class where you have overflow: hidden;

Dobiatowski
when i removed the OVERFLOW:auto; the horizontal scroll bar disappeared.
Codeffect
i need the horizontal scroll bar of the div and to remove the vertical scroll bar of the listbox
Codeffect
so set overflow-x: hidden; overflow-y:auto; like pranay_stacker said
Dobiatowski
<div id="lstQueriesDiv" style="overflow-x: hidden; overflow-y:auto; Width: 650px; height:167px;" > <asp:ListBox ID="lstQueries" runat="server" CssClass="cssLstQueries" Rows="9" ></asp:ListBox> </div>.cssLstQueries{Width:auto;}and still no horizontal scrollbar
Codeffect
check my sample its working http://pastebin.com/YivFUDbe
Dobiatowski
The problem is that the vertical scrollbar of the listbox is visible .
Codeffect
<div id="lstQueriesDiv" style="overflow-x:auto; overflow-y:hidden; Width: 650px; height:167px;" > <asp:ListBox ID="lstQueries" runat="server" CssClass="cssLstQueries" Rows="9" ></asp:ListBox> </div>.cssLstQueries{Width:auto;overflow:hidden;-ms-overflow-x: hidden;-ms-overflow-y: hidden;}
Codeffect
cssLstQueries is the css of the listbox and is not hiding the vertical scrollbar
Codeffect
Still not working
Codeffect
I want to hide the vertical scrollbar of the listbox not the the vertical scrollbar of the div.
Codeffect