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

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

FormView.TopPagerRow プロパティ

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

FormView コントロールの上部に表示されるページ行を表す FormViewRow オブジェクト取得します

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

Public Overridable ReadOnly
 Property TopPagerRow As FormViewRow
Dim instance As FormView
Dim value As FormViewRow

value = instance.TopPagerRow
public virtual FormViewRow TopPagerRow { get;
 }
public:
virtual property FormViewRow^ TopPagerRow {
    FormViewRow^ get ();
}
/** @property */
public FormViewRow get_TopPagerRow ()
public function get TopPagerRow
 () : FormViewRow

プロパティ
FormView コントロールの上部のページ行を表す FormViewRow

解説解説
使用例使用例

TopPagerRow プロパティ使用してFormView コントロールの上部に表示されるページ行にアクセスする方法次の例に示しますその後ページ行は、追加コンテンツ更新されます。

<%@ Page language="VB" %>

<script runat="server">

  Sub EmployeeFormView_ItemCreated(ByVal sender
 As Object, ByVal e As
 EventArgs)

    ' Get the pager row.
    Dim pagerRow As FormViewRow = EmployeeFormView.TopPagerRow

    ' Get the Label controls that display the current page information
 
    ' from the pager row.
    Dim pageNum As Label = CType(pagerRow.FindControl("PageNumberLabel"),
 Label)
    Dim totalNum As Label = CType(pagerRow.FindControl("TotalPagesLabel"),
 Label)

    If pageNum IsNot Nothing And
 totalNum IsNot Nothing Then

      ' Update the Label controls with the current page values.
      Dim page As Integer
 = EmployeeFormView.PageIndex + 1
      Dim count As Integer
 = EmployeeFormView.PageCount

      pageNum.Text = page.ToString()
      totalNum.Text = count.ToString()
    
    End If

  End Sub
    
</script>

<html>
  <body>
    <form runat="server">
        
      <h3>FormView PagerTemplate Example</h3>
                       
      <asp:formview id="EmployeeFormView"
        datasourceid="EmployeeSource"
        allowpaging="true"
        datakeynames="EmployeeID"
        onitemcreated="EmployeeFormView_ItemCreated"
 
        runat="server">
        
        <itemtemplate>
          <table>
            <tr>
              <td>
                <asp:image id="EmployeeImage"
                  imageurl='<%# Eval("PhotoPath") %>'
                  alternatetext='<%# Eval("LastName") %>'
 
                  runat="server"/>
              </td>
              <td>
                <h3><%# Eval("FirstName")
 %>&nbsp;<%# Eval("LastName") %></h3>
      
                <%# Eval("Title") %>       
 
              </td>
            </tr>
          </table>    
        </itemtemplate>
        
        <pagertemplate>   
          <table width="100%">
            <tr>
              <td>
                <asp:linkbutton id="PreviousButton"
                  text="<"
                  commandname="Prev"
                  runat="Server"/>
                <asp:linkbutton id="NextButton"
                  text=">"
                  commandName="Next"
                  runat="Server"/> 
              </td>
              <td align="right">           
     
                Page <asp:label id="PageNumberLabel"
 runat="server"/> 
                of <asp:label id="TotalPagesLabel"
 runat="server"/>                
              </td>
            </tr>
          </table>          
        </pagertemplate>
          
        <pagersettings position="Top"
          mode="NextPrevious"/> 
                  
      </asp:formview>
          
      <!-- 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="EmployeeSource"
        selectcommand="Select [EmployeeID], [LastName], [FirstName],
 [Title], [PhotoPath] From [Employees]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
 
        runat="server"/>
            
    </form>
  </body>
</html>

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

<script runat="server">

  void EmployeeFormView_ItemCreated(Object sender, EventArgs e)
  {

    // Get the pager row.
    FormViewRow pagerRow = EmployeeFormView.TopPagerRow;

    // Get the Label controls that display the current page information
 
    // from the pager row.
    Label pageNum = (Label)pagerRow.FindControl("PageNumberLabel");
    Label totalNum = (Label)pagerRow.FindControl("TotalPagesLabel");

    if ((pageNum != null) && (totalNum
 != null))
    {
      // Update the Label controls with the current page values.
      int page = EmployeeFormView.PageIndex + 1;
      int count = EmployeeFormView.PageCount;

      pageNum.Text = page.ToString();
      totalNum.Text = count.ToString();
    }

  }
    
</script>

<html>
  <body>
    <form runat="server">
        
      <h3>FormView PagerTemplate Example</h3>
                       
      <asp:formview id="EmployeeFormView"
        datasourceid="EmployeeSource"
        allowpaging="true"
        datakeynames="EmployeeID"
        onitemcreated="EmployeeFormView_ItemCreated" 
        runat="server">
        
        <itemtemplate>
          <table>
            <tr>
              <td>
                <asp:image id="EmployeeImage"
                  imageurl='<%# Eval("PhotoPath") %>'
                  alternatetext='<%# Eval("LastName") %>' 
                  runat="server"/>
              </td>
              <td>
                <h3><%# Eval("FirstName") %>&nbsp;<%#
 Eval("LastName") %></h3>      
                <%# Eval("Title") %>        
              </td>
            </tr>
          </table>    
        </itemtemplate>
        
        <pagertemplate>   
          <table width="100%">
            <tr>
              <td>
                <asp:linkbutton id="PreviousButton"
                  text="<"
                  commandname="Prev"
                  runat="Server"/>
                <asp:linkbutton id="NextButton"
                  text=">"
                  commandName="Next"
                  runat="Server"/> 
              </td>
              <td align="right">                
                Page <asp:label id="PageNumberLabel" runat="server"/>
 
                of <asp:label id="TotalPagesLabel" runat="server"/>
                
              </td>
            </tr>
          </table>          
        </pagertemplate>
          
        <pagersettings position="Top"
          mode="NextPrevious"/> 
                  
      </asp:formview>
          
      <!-- 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="EmployeeSource"
        selectcommand="Select [EmployeeID], [LastName], [FirstName], [Title],
 [PhotoPath] From [Employees]"
        connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>"
 
        runat="server"/>
            
    </form>
  </body>
</html>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
FormView クラス
FormView メンバ
System.Web.UI.WebControls 名前空間
FormViewRow
FormView.AllowPaging プロパティ
FormView.PageCount プロパティ
FormView.PageIndex プロパティ
FormView.PagerSettings プロパティ
FormView.PagerStyle プロパティ
FormView.PagerTemplate プロパティ
FormView.BottomPagerRow プロパティ
ItemCreated
PageIndexChanged
PageIndexChanging


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

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

辞書ショートカット

すべての辞書の索引

「FormView.TopPagerRow プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS