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

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

FormView.AllowPaging プロパティ

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

ページング機能有効にするかどうかを示す値を取得または設定します

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

Public Overridable Property
 AllowPaging As Boolean
Dim instance As FormView
Dim value As Boolean

value = instance.AllowPaging

instance.AllowPaging = value
public virtual bool AllowPaging { get;
 set; }
/** @property */
public boolean get_AllowPaging ()

/** @property */
public void set_AllowPaging (boolean value)

プロパティ
ページング機能有効にする場合trueそれ以外場合false既定値false です。

解説解説

FormView コントロールには、ユーザーデータ ソース内の別のレコード移動できるページング機能ありますページング機能は、System.Collections.ICollection インターフェイスサポートするデータ ソース オブジェクト、またはページング機能サポートするデータ ソース使用できます

ページング機能有効にするには、AllowPaging プロパティtrue設定します。PageCount プロパティ使用すると、基になるデータ ソース合計項目数確認できます。現在表示されている項目のインデックス確認するには、PageIndex プロパティ使用します

ページング有効になっている場合ページ行と呼ばれる追加行が自動的に FormView コントロール表示されます。ページ行にはページ ナビゲーション コントロール含まれコントロールの上部、下部、または上部下部両方表示できますページ行には、4 つ組み込みページャ表示モードあります。この 4 つモード次の表に示します

ページ行の設定 (ページャ表示モード一度表示するページ リンクの数、ページャ コントロールテキスト ラベルなど) は、PagerSettings プロパティ使用して制御できますページ行の外観 (背景色フォントの色など) を制御するには、PagerStyle プロパティ使用しますFormView コントロールでは、ページ行用のカスタム テンプレートも定義できますカスタム ページテンプレート作成詳細については、PagerTemplate のトピック参照してください

FormView コントロールには、ページング発生したときにカスタム アクション実行するために使用できる複数イベント用意されています。使用できるイベントの一覧を次の表に示します

メモメモ

これらのイベントは、プログラムによって PageIndex プロパティ変更した場合には発生しません。

使用例使用例

AllowPaging プロパティ使用してFormView コントロールページング機能有効にする方法次の例に示します

<%@ Page language="VB" %>

<html>
  <body>
    <form runat="server">
        
      <h3>FormView AllowPaging Example</h3>
                       
      <asp:formview id="EmployeeFormView"
        datasourceid="EmployeeSource"
        allowpaging="true"
        datakeynames="EmployeeID" 
        runat="server">
        
        <pagersettings mode="Numeric"
          position="Bottom"/>
          
        <pagerstyle backcolor="LightBlue"
          horizontalalign="Center"/>
        
        <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> 
                  
      </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#" %>

<html>
  <body>
    <form runat="server">
        
      <h3>FormView AllowPaging Example</h3>
                       
      <asp:formview id="EmployeeFormView"
        datasourceid="EmployeeSource"
        allowpaging="true"
        datakeynames="EmployeeID" 
        runat="server">
        
        <pagersettings mode="Numeric"
          position="Bottom"/>
          
        <pagerstyle backcolor="LightBlue"
          horizontalalign="Center"/>
        
        <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> 
                  
      </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 名前空間
BottomPagerRow
PageCount
PageIndex
PagerSettings
PagerStyle
PagerTemplate
TopPagerRow
PageIndexChanged
PageIndexChanging


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

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

辞書ショートカット

すべての辞書の索引

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

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

   

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



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

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

©2025 GRAS Group, Inc.RSS