Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

Attempting to add a scrollbar to a datagrid but to no avail. I have tried both the Div tag and Panel. Here are some of the variations:
ASP.NET
<div style="vertical-align:top; height: 52px; overflow:auto; width:300px;">

<div style="height: 52px; overflow:scroll; width:300px;">

<asp:Panel runat="server" style="overflow:scroll; width:85%; height:300px;"> 

<asp:Panel ScrollBars="Auto" runat="server" Wrap="true">

<asp:Panel runat="server" style="overflow:scroll; width:300px; height:50px; vertical-align:;"> 

<asp:DataGrid id="grdCharges" 
                style="z-index:101; left:40px; top:384px; font-family:'Arial'; font-size:9pt; position:absolute;" 
                runat="server" Width="654" Height="97px" AutoGenerateColumns="False" 
                BorderStyle="NotSet" CssClass="GridAppearanceStyle" HeaderStyle-CssClass="GridHeaderStyle" ItemStyle-CssClass="GridItemStyle">
    <ItemStyle CssClass="GridItemStyle" />
    <Columns>
        <asp:BoundColumn DataField="Account_No" HeaderText="Account_No">
        </asp:BoundColumn>
        ......
        <asp:ButtonColumn CommandName="Select" HeaderText="row_selector" Text="Select">
        </asp:ButtonColumn>
    </Columns>
    <HeaderStyle BackColor="Control" />
</asp:DataGrid>
</div>
<!--</Panel>-->



The scrollbar does appear but not adjacent to the grid. It show on top of other controls in the web page.


Any help is appreciated.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900