<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestGridView.aspx.cs" Inherits="TestGridView" %>

<!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 id="Head1" runat="server">
   <title>Testowanie kontrolki GridView</title>
   <link href="chapterStyles.css" type="text/css" rel="stylesheet" />
</head>
<body>
   <form id="form1" runat="server">
      <div id="container">
         <h1>Testowanie kontrolki GridView</h1>
         <p>
         W przykładzie pokazano, jak używać kontrolki <code>GridView</code>.
         </p>
         <asp:GridView ID="grdSample" runat="server" DataSourceID="dsBooks"
           AutoGenerateColumns="False" BackColor="White"
           BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" 
           CellPadding="4" GridLines="Vertical" ForeColor="Black">

            <Columns>
               <asp:ImageField HeaderText="" DataImageUrlField="Isbn" 
                  DataImageUrlFormatString="images/{0}.gif"
                  DataAlternateTextField="Title" 
                  DataAlternateTextFormatString="Okładka {0}"
                  ReadOnly="True" />
               <asp:BoundField DataField="ISBN" HeaderText="Isbn" ReadOnly="True"/>                
               <asp:BoundField DataField="Title" HeaderText="Tytuł"/>
               <asp:BoundField DataField="PublisherName" HeaderText="Wydawca" />
               <asp:BoundField DataField="YearPublished" HeaderText="Rok"/>             
            </Columns>
            <FooterStyle BackColor="#CCCC99" />
            <RowStyle BackColor="#F7F7DE" />
            <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
            <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" />
         </asp:GridView>               
      </div>
		<asp:SqlDataSource ID="dsBooks" runat="server"
			 ProviderName="System.Data.SqlClient" 
			 ConnectionString="<%$ ConnectionStrings:BookCatalog %>"
			 SelectCommand="SELECT ISBN,Title,PublisherName,YearPublished FROM Books INNER JOIN Publishers ON Books.PublisherId=Publishers.PublisherId" />
   </form>
</body>
</html>
