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

<!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;
      }
      
      .list { border: solid 1pt #DEDFDE; }
      .listRow { background-color: #F7F7DE; }
      .listHeader { background-color:#6B696B; font-weight: bold; color: White; }
      .listAlt { background-color: white; }
      .listFooter { background-color:#CE5D5A; font-weight: bold; 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="dsArt"
   AutoGenerateColumns="False" 
   CssClass="list" ShowFooter="true"
   CellPadding="4" GridLines="Vertical" 
   OnRowDataBound="grdSample_RowDataBound" OnDataBound="grdSample_DataBound"  >

   <Columns>               
      <asp:BoundField DataField="Title" HeaderText="Tytuł" />
      <asp:BoundField DataField="Price" HeaderText="Cena" DataFormatString="{0:c}" HtmlEncode="false"/>
      <asp:BoundField DataField="Cost" HeaderText="Koszt"  DataFormatString="{0:F3}" HtmlEncode="false"/>             
   </Columns>
   <RowStyle CssClass="listRow" />
   <HeaderStyle CssClass="listHeader" />
   <AlternatingRowStyle CssClass="listAlt" />
   <FooterStyle CssClass="listFooter" HorizontalAlign="Right"/>
</asp:GridView>               
      </div>
		<asp:SqlDataSource ID="dsArt" runat="server"
			 ProviderName="System.Data.SqlClient" 
			 ConnectionString="<%$ ConnectionStrings:ModernEye %>"
			 SelectCommand="SELECT TOP 10 Title, Price, Cost FROM ArtWorks" />
   </form>
</body>
</html>



