GridView.FooterRow プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > GridView.FooterRow プロパティの意味・解説 

GridView.FooterRow プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

GridView コントロールフッター行を表す GridViewRow オブジェクト取得します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Overridable ReadOnly
 Property FooterRow As GridViewRow
Dim instance As GridView
Dim value As GridViewRow

value = instance.FooterRow
public virtual GridViewRow FooterRow { get;
 }
public:
virtual property GridViewRow^ FooterRow {
    GridViewRow^ get ();
}
/** @property */
public GridViewRow get_FooterRow ()
public function get FooterRow
 () : GridViewRow

プロパティ
GridView コントロールフッター行を表す GridViewRow

解説解説

プログラムによって、GridView コントロールフッター行を表す GridViewRow オブジェクトアクセスするには、FooterRow プロパティ使用します

メモメモ

FooterRow プロパティは、RowCreated イベントGridView コントロールによってフッター行が作成された後にしか使用できません。

通常、このプロパティは、プログラムによってフッター行を操作する必要がある場合 (カスタム コンテンツ追加する場合など) に使用されます。FooterRow プロパティへの変更は、GridView コントロール表示された後に行う必要がありますそうしないと、GridView コントロールによって変更上書きされます

使用例使用例

FooterRow プロパティ使用してフッター行に並べ替え方向表示する方法次のコード例示します

<%@ Page language="VB" %>

<script runat="server">
  
  Sub CustomersGridView_DataBound(ByVal sender
 As Object, ByVal e As
 EventArgs)
      
    ' Get the header row.
    Dim headerRow As GridViewRow = CustomersGridView.HeaderRow
    
    ' Get the footer row.
    Dim footerRow As GridViewRow = CustomersGridView.FooterRow

    ' Set the font color of the header and footer rows
    ' based on the sort direction. 
    Select Case CustomersGridView.SortDirection

      Case SortDirection.Ascending
        headerRow.ForeColor = System.Drawing.Color.Green
        footerRow.ForeColor = System.Drawing.Color.Green
      Case SortDirection.Descending
        headerRow.ForeColor = System.Drawing.Color.Red
        footerRow.ForeColor = System.Drawing.Color.Red
      Case Else
        headerRow.ForeColor = System.Drawing.Color.Black
        footerRow.ForeColor = System.Drawing.Color.Black
        
    End Select

    ' Display the sort order in the footer row.
    footerRow.Cells(0).Text = "Sort Order = " &
 CustomersGridView.SortDirection.ToString()
      
  End Sub
    
</script>

<html>
  <body>
    <form runat="server">
        
      <h3>GridView HeaderRow and FooterRow Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowsorting="true"
        allowpaging="true" 
        showheader="true"
        showfooter="true"
        ondatabound="CustomersGridView_DataBound"
    
        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>

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

<script runat="server">
  
  void CustomersGridView_DataBound(Object sender, EventArgs e)
  {
    
    // Get the header row.
    GridViewRow headerRow = CustomersGridView.HeaderRow;   
    
    // Get the footer row.
    GridViewRow footerRow = CustomersGridView.FooterRow; 

    // Set the font color of the header and footer rows
    // based on the sort direction. 
    switch (CustomersGridView.SortDirection)
    {
      case SortDirection.Ascending:
        headerRow.ForeColor = System.Drawing.Color.Green;
        footerRow.ForeColor = System.Drawing.Color.Green;
        break;
      case SortDirection.Descending:
        headerRow.ForeColor = System.Drawing.Color.Red;
        footerRow.ForeColor = System.Drawing.Color.Red;
        break;
      default:
        headerRow.ForeColor = System.Drawing.Color.Black;
        footerRow.ForeColor = System.Drawing.Color.Black;
        break;
    }

    // Display the sort order in the footer row.
    footerRow.Cells[0].Text = "Sort Order = " + CustomersGridView.SortDirection.ToString();
      
  }
    
</script>

<html>
  <body>
    <form runat="server">
        
      <h3>GridView HeaderRow and FooterRow Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowsorting="true"
        allowpaging="true" 
        showheader="true"
        showfooter="true"
        ondatabound="CustomersGridView_DataBound"    
        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>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
GridView クラス
GridView メンバ
System.Web.UI.WebControls 名前空間
GridView.BottomPagerRow プロパティ
HeaderRow
Rows
ShowFooter
TopPagerRow


このページでは「.NET Framework クラス ライブラリ リファレンス」からGridView.FooterRow プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からGridView.FooterRow プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からGridView.FooterRow プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「GridView.FooterRow プロパティ」の関連用語

GridView.FooterRow プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



GridView.FooterRow プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS