Click here to Skip to main content
15,915,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<asp:GridView ID="SalesGrid" runat="server" AllowPaging="true"
        BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px"
        CaptionAlign="Top" CellPadding="4"
        style="z-index: 1; left: 101px; top: 411px; position: absolute; height: 313px; width: 554px; bottom: -228px;"
        GridLines="Both" onrowdatabound="GridView1_RowDataBound"
        onpageindexchanging="GridView1_PageIndexChanging"
        ondatabound="SalesGrid_DataBound" Visible="False"
        ShowFooter="true"
        onrowcreated="SalesGrid_RowCreated">

        <EditRowStyle Wrap="False" />
        <FooterStyle BackColor="LightBlue" BorderColor="Red" ForeColor="#333333" Font-Bold="true"/>
        <HeaderStyle BackColor="#336666" ForeColor="White" Font-Bold="True" />
        <PagerStyle ForeColor="White" BackColor="#336666" HorizontalAlign="Center" />
        <RowStyle BackColor="White" ForeColor="#333333" Wrap="False" />
        <SelectedRowStyle BackColor="#339966"  BorderColor="AliceBlue" ForeColor="White" Font-Bold="true" />
        <SortedAscendingCellStyle BackColor="#F7F7F7" />
        <SortedAscendingHeaderStyle BackColor="#487575" />
        <SortedDescendingCellStyle BackColor="#E5E5E5" />
        <SortedDescendingHeaderStyle BackColor="#275353" />
    </asp:GridView>
Posted
Comments
Member 10222278 28-Sep-13 3:21am    
Version 4.0

1 solution

Use div to have vertical scroll bar inside the GridView.
ASP
<div id="divGridViewScroll" style="width: 600px; height: 400px; overflow: scroll"></div>

For rest see:
Horizontal Scrollbars in GridView[^]
Fixed GridView Header with horizontal and vertical scrolling in asp.net[^]
 
Share this answer
 
Comments
Member 10222278 28-Sep-13 3:59am    
<div id="grdCharges" runat="server" style="width: 875px; overflow: auto; height: 160px;">
<asp:GridView ID="ProductGrid" runat="server" AllowPaging="true" CssClass="grid_scroll"
BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px"
CaptionAlign="Top" CellPadding="4"
AutoGenerateColumns="true"
style="z-index: 1; left: 366px; top: 152px; position: absolute; height: 126px; width: 567px; bottom: 91px;"
GridLines="Both"
onrowdatabound="ProductGrid_RowDataBound"
onpageindexchanging="ProductGrid_PageIndexChanging"
ondatabound="ProductGrid_DataBound"
onrowcreated="ProductGrid_RowCreated" >

<editrowstyle wrap="False">
<footerstyle backcolor="LightBlue" bordercolor="Red" forecolor="#333333" font-bold="true">
<HeaderStyle BackColor="#336666" ForeColor="White" Font-Bold="True" />
<PagerStyle ForeColor="White" BackColor="#336666" HorizontalAlign="Center" />
<rowstyle backcolor="White" forecolor="#333333" wrap="False">
<SelectedRowStyle BackColor="#339966" BorderColor="AliceBlue" ForeColor="White" Font-Bold="true" />
<sortedascendingcellstyle backcolor="#F7F7F7">
<sortedascendingheaderstyle backcolor="#487575">
<sorteddescendingcellstyle backcolor="#E5E5E5">
<sorteddescendingheaderstyle backcolor="#275353">

</div>
ridoy 28-Sep-13 4:12am    
Change your first line with <div id="divGridViewScroll" style="width: 600px; height: 400px; overflow: scroll">
Member 10222278 28-Sep-13 4:00am    
It's not working?
Member 10222278 28-Sep-13 6:15am    
Hi,DIV visibility hideen in run mode please help me...
ridoy 28-Sep-13 7:50am    
there are no possibility of div to be hidden,check whether you make it hidden or not.

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