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

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

DetailsView.FooterRow プロパティ

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

DetailsView コントロールのフッター行を表す DetailsViewRow オブジェクトを取得します。

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

Public Overridable ReadOnly
 Property FooterRow As DetailsViewRow
Dim instance As DetailsView
Dim value As DetailsViewRow

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

プロパティ値
DetailsView コントロールのフッター行を表す DetailsViewRow。

解説解説

FooterText プロパティまたは FooterTemplate プロパティが設定されている場合、DetailsView コントロールの下部にフッター行が表示されます。プログラムによって、フッター行を表す DetailsViewRow オブジェクトにアクセスするには、FooterRow プロパティを使用します。

メモメモ

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

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

フッター行のスタイルを制御するには、FooterStyle プロパティを使用します。

使用例使用例

FooterRow プロパティを使用して、ItemCreated イベント中に DetailsView コントロールのフッター行にアクセスする方法のコード例を次に示します。カスタム フッター行の中の Label コントロールが現在のページ番号で更新されます。

<%@ Page language="VB" %>

<script runat="server">

    Protected Sub CustomerDetailView_DataBound(ByVal
 sender As Object, _
        ByVal e As EventArgs)
        ' Get the footer row.
        Dim footerRow As DetailsViewRow = CustomerDetailView.FooterRow

        ' Get the Label control that displays the current page 
        ' information from the footer row.
        Dim pageNum As Label = _
            CType(footerRow.Cells(0).FindControl("PageNumberLabel"),
 Label)

        If pageNum IsNot Nothing Then
            ' Update the Label control with the current page number.
            Dim page As Integer
 = CustomerDetailView.DataItemIndex + 1
            pageNum.Text = "Page " + page.ToString()
        End If
    End Sub
</script>

<html>
  <body>
    <form id="Form1" runat="server">
        
      <h3>DetailsView FooterTemplate Example</h3>
                
        <asp:detailsview id="CustomerDetailView"
          datasourceid="DetailsViewSource"
          datakeynames="CustomerID"
          autogeneraterows="true"
          allowpaging="true"
          runat="server" 
          OnDataBound="CustomerDetailView_DataBound">
               
          <headerstyle backcolor="Navy"
            forecolor="White"/>
            
          <pagersettings Mode="NextPreviousFirstLast"/>
  
            
          <FooterTemplate>
          
            <table width="100%">           
 
              <tr>
                <td align="left">
                  <asp:Image id="LogoImage"
                    imageurl="~\images\Logo.jpg"
                    runat="server"/>
                </td>
                <td align="right" valign="bottom">
                  <asp:Label id="PageNumberLabel"
                    font-size="9"
                    forecolor="DodgerBlue"
                    runat="server"/>
                </td>
              </tr>            
            </table>
          
          </FooterTemplate>
                    
        </asp:detailsview>
        
        <!-- 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="DetailsViewSource"
 runat="server" 
          ConnectionString=
            "<%$ ConnectionStrings:NorthWindConnectionString%>"
          InsertCommand="INSERT INTO [Customers]([CustomerID],
            [CompanyName], [Address], [City], [PostalCode], [Country]) 
            VALUES (@CustomerID, @CompanyName, @Address, @City, 
            @PostalCode, @Country)"

          SelectCommand="Select [CustomerID], [CompanyName], 
            [Address], [City], [PostalCode], [Country] From 
            [Customers]">
        </asp:SqlDataSource>
    </form>
  </body>
</html>

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

<script runat="server">

    protected void CustomerDetailView_DataBound(object
 sender, 
        EventArgs e)
    {
        // Get the footer row.
        DetailsViewRow footerRow = CustomerDetailView.FooterRow;

        // Get the Label control that displays the current page 
        // information from the footer row.
        Label pageNum = 
            (Label)footerRow.Cells[0].FindControl("PageNumberLabel");

        if (pageNum != null)
        {

            // Update the Label control with the current page number.
            int page = CustomerDetailView.DataItemIndex + 1;
            pageNum.Text = "Page " + page.ToString();

        }
    }
</script>

<html>
  <body>
    <form id="Form1" runat="server">
        
      <h3>DetailsView FooterTemplate Example</h3>
                
        <asp:detailsview id="CustomerDetailView"
          datasourceid="DetailsViewSource"
          datakeynames="CustomerID"
          autogeneraterows="true"
          allowpaging="true"
          runat="server" 
          OnDataBound="CustomerDetailView_DataBound">
               
          <headerstyle backcolor="Navy"
            forecolor="White"/>
            
          <pagersettings Mode="NextPreviousFirstLast"/>  
            
          <FooterTemplate>
          
            <table width="100%">            
              <tr>
                <td align="left">
                  <asp:Image id="LogoImage"
                    imageurl="~\images\Logo.jpg"
                    runat="server"/>
                </td>
                <td align="right" valign="bottom">
                  <asp:Label id="PageNumberLabel"
                    font-size="9"
                    forecolor="DodgerBlue"
                    runat="server"/>
                </td>
              </tr>            
            </table>
          
          </FooterTemplate>
                    
        </asp:detailsview>
        
        <!-- 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="DetailsViewSource" runat="server"
 
          ConnectionString=
            "<%$ ConnectionStrings:NorthWindConnectionString%>"
          InsertCommand="INSERT INTO [Customers]([CustomerID],
            [CompanyName], [Address], [City], [PostalCode], [Country]) 
            VALUES (@CustomerID, @CompanyName, @Address, @City, 
            @PostalCode, @Country)"

          SelectCommand="Select [CustomerID], [CompanyName], 
            [Address], [City], [PostalCode], [Country] From 
            [Customers]">
        </asp:SqlDataSource>
    </form>
  </body>
</html>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DetailsView クラス
DetailsView メンバ
System.Web.UI.WebControls 名前空間
DetailsViewRow
FooterStyle
HeaderRow



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

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

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

   

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



DetailsView.FooterRow プロパティのページの著作権

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

©2026 GRAS Group, Inc.RSS