FormView.AllowPaging プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As FormView Dim value As Boolean value = instance.AllowPaging instance.AllowPaging = value
/** @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 つのモードを次の表に示します。
PagerButton.NextPrevious | |
PagerButton.NextPreviousFirstLast | |
PagerButton.Numeric | |
PagerButton.NumericFirstLast |
ページ行の設定 (ページャ表示モード、一度に表示するページ リンクの数、ページャ コントロールのテキスト ラベルなど) は、PagerSettings プロパティを使用して制御できます。ページ行の外観 (背景色やフォントの色など) を制御するには、PagerStyle プロパティを使用します。FormView コントロールでは、ページ行用のカスタム テンプレートも定義できます。カスタム ページ行テンプレートの作成の詳細については、PagerTemplate のトピックを参照してください。
FormView コントロールには、ページングが発生したときにカスタム アクションを実行するために使用できる複数のイベントが用意されています。使用できるイベントの一覧を次の表に示します。

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") %> <%# 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") %> <%# 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>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からFormView.AllowPaging プロパティを検索する場合は、下記のリンクをクリックしてください。

- FormView.AllowPaging プロパティのページへのリンク