GridView PagerSettings and PagerStyle in asp.net

GridView PagerSettings and PagerStyle
GridViewPagerSettingsExample.aspx

<%@ Page Language="C#" %>

<!DOCTYPE html>

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>asp.net GridView PagerSettings and PagerStyle example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Gray">PagerSettings and PagerStyle In GridView</h2>
        <asp:SqlDataSource
             ID="SqlDataSource1"
             runat="server"
             ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
             SelectCommand="SELECT ProductID, ProductName, UnitPrice FROM Products"
             >
        </asp:SqlDataSource>
        <asp:GridView
             ID="GridView1" 
             runat="server"
             DataSourceID="SqlDataSource1"
             AutoGenerateColumns="false"
             BackColor="Snow"
             ForeColor="Magenta"
             BorderColor="DimGray"
             BorderStyle="Double"
             BorderWidth="2"
             AllowSorting="false"
             AllowPaging="true"
             PageSize="5"
             >
            <Columns>
                <asp:BoundField HeaderText="Product ID" DataField="ProductID" />
                <asp:BoundField HeaderText="Product Name" DataField="ProductName" />
                <asp:BoundField HeaderText="Unit Price" DataField="UnitPrice" />
            </Columns>
            <PagerSettings FirstPageText="First Page" LastPageText="Last Page" Mode="NumericFirstLast" Position="TopAndBottom" />
            <PagerStyle BackColor="Lavender" ForeColor="LightSlateGray" />
        </asp:GridView>
    </div>
    </form>
</body>
</html>
Related asp.net examples