.NET GridView使用滚动条(通过<div>)

<div style="height: 450px; 350px; overflow-x: auto; overflow-y: auto;">

      <asp:GridView ID="GridView1" runat="server" BackColor="LightGoldenrodYellow" BorderColor="Tan"
                 BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None" AutoGenerateColumns="False"
                 Height="100px" Width="301px">
                 <FooterStyle BackColor="Tan" />
                     <Columns>
                         <asp:BoundField HeaderText="NAME" DataField="Name" />
                         <asp:BoundField HeaderText="COUNT" DataField="Count" />
                         <asp:BoundField HeaderText="SUM" DataField="Sum" />
                         <asp:BoundField HeaderText="AVERAGE" DataField="Average" />
                     </Columns>
                         <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                         <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
                         <HeaderStyle BackColor="Tan" Font-Bold="True" />
                         <AlternatingRowStyle BackColor="PaleGoldenrod" />
      </asp:GridView>
</div>

原文地址:https://www.cnblogs.com/liufei88866/p/1925176.html