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>

浙公网安备 33010602011771号