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

<!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>Dostosowywanie wierszy kontrolki GridView</title>
   <link href="chapterStyles.css" type="text/css" rel="stylesheet" />
   <style type="text/css">
      .box {
         margin: 1em 0; border: solid 1pt silver; padding: 0.5em;
      }
      
      .bookList { border: solid 1pt #DEDFDE; }
      .bookListRow { background-color: #F7F7DE; }
      .bookListSelected { background-color:#CE5D5A; font-weight: bold; color: White; }
      .bookListPager { background-color:#F7F7DE; font-weight: bold; color: Black; }
      .bookListHeader { background-color:#6B696B; font-weight: bold; color: White; }
      .bookListAlt { background-color: white; }
         
   </style>
</head>
<body>
   <form id="form1" runat="server">
      <div id="container">
         <h1>Dostosowywanie wierszy kontrolki GridView</h1>
         <p>
         W przykładzie pokazano, jak programowo dostosowywać kontrolkę <code>GridView</code>.
         </p>
            <asp:GridView ID="grdSample" runat="server" DataSourceID="dsBooks"
               AutoGenerateColumns="False" 
               CssClass="bookList"
               CellPadding="4" GridLines="Vertical" 
               OnRowDataBound="grdSample_RowDataBound"  >

            <Columns>
               <asp:BoundField DataField="ISBN" HeaderText="Isbn" />                
               <asp:BoundField DataField="Title" HeaderText="Tytuł" />
               <asp:BoundField DataField="PublisherName" HeaderText="Wydawca" />
               <asp:BoundField DataField="YearPublished" HeaderText="Rok" />             
            </Columns>
            <RowStyle CssClass="bookListRow" />
            <HeaderStyle CssClass="bookListHeader" />
            <AlternatingRowStyle CssClass="bookListAlt" />
         </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>


