|
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="home.aspx.cs" Inherits="home" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Tom Bauto - Sample Gridview Binding with Paging from SQL 2005</title>
<style type="text/css">
body
{
font-family:Verdana;
font-size:10px;
font-weight:normal;
}
.numtxt
{
font-family:Verdana;
font-size:10px;
font-weight:normal;
width:30px;
height:12px;
text-align:center;
}
.dtxt
{
font-family:Verdana;
font-size:10px;
font-weight:normal;
width:50px;
height:18px;
text-align:left;
}
.btn
{
font-family:Verdana;
font-size:10px;
font-weight:normal;
height:20px;
width:60px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4" GridLines="Both" Width="1000px" AutoGenerateColumns="false">
<RowStyle BackColor="White" ForeColor="#333333" />
<FooterStyle BackColor="White" ForeColor="#333333" />
<PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#DCE7F0" />
<RowStyle Height="20px" />
<Columns>
<asp:BoundField DataField="ProductId" HeaderText="Id"><ItemStyle Width="100px" /></asp:BoundField>
<asp:BoundField DataField="CompanyName" HeaderText="Company"><ItemStyle Width="350px" /></asp:BoundField>
<asp:BoundField DataField="ProductName" HeaderText="Product"><ItemStyle Width="250px" /></asp:BoundField>
<asp:BoundField DataField="UnitPrice" HeaderText="Price"><ItemStyle Width="200px" /></asp:BoundField>
<asp:BoundField DataField="UnitsInStock" HeaderText="Units"><ItemStyle Width="100px" /></asp:BoundField>
</Columns>
</asp:GridView>
<div style="width:900px; text-align:left;">
<table>
<tr>
<td style="height:30px;">
<div id="div_total_records" runat="server"></div>
</td>
<td style="height:30px;">
Rows per result: <asp:TextBox ID="txtTotalRowsPerPage" runat="server" CssClass="numtxt"></asp:TextBox>
</td>
<td valign="middle">
Jump: <asp:TextBox ID="txtPage" runat="server" CssClass="numtxt"></asp:TextBox>
</td>
<td valign="middle">
<asp:Button ID="btnJump" runat="server" Text="Jump" CssClass="btn" />
</td>
<td valign="middle">
<asp:DropDownList ID="txtJumpToPage" runat="server" AutoPostBack="true" CssClass="dtxt"></asp:DropDownList>
</td>
<td valign="middle">
<asp:Button ID="btnPrevious" runat="server" Text="Previous" CssClass="btn" />
</td>
<td valign="middle">
<asp:Button ID="btnNext" runat="server" Text="Next" CssClass="btn" />
</td>
</tr>
</table>
</div>
</div>
</form>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.