GridView.FooterStyle 属性

获取对 TableItemStyle 对象的引用,使用该对象可以设置 GridView 控件中的脚注行的外观。

 

 

下面的代码示例演示如何使用 FooterStyle 属性为 GridView 控件中的脚注行定义自定义样式。

 

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

<html>
  <body>
    <form runat="server">
       
      <h3>GridView ShowHeader and ShowFooter Example</h3>

      <asp:gridview id="CustomersGridView"
        datasourceid="CustomersSource"
        autogeneratecolumns="true"
        emptydatatext="No data available."
        showheader="true"
        showfooter="true"
        runat="server">
        
        <headerstyle backcolor="LightCyan"
          forecolor="MediumBlue"/>
                   
        <footerstyle backcolor="LightCyan"
          forecolor="MediumBlue"/>
                                    
      </asp:gridview>
           
      <!-- This example uses Microsoft SQL Server and connects  -->
      <!-- to the Northwind sample database. Use an ASP.NET     -->
      <!-- expression to retrieve the connection string value   -->
      <!-- from the Web.config file.                            -->
      <asp:sqldatasource id="CustomersSource"
        selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
        runat="server"/>
       
    </form>
  </body>
</html>

 

posted @ 2009-04-17 13:10  minmin8110  阅读(645)  评论(0)    收藏  举报