PagerSettings クラス
アセンブリ: System.Web (system.web.dll 内)


改ページ位置の自動修正をサポートするコントロール (GridView、DetailsView、および FormView の各コントロールなど) は、ユーザーがコントロール内のページを移動できるようにするページャと呼ばれる一連のコントロールを表示できます。PagerSettings クラスは、ページャのプロパティを表すためにこれらのコントロールによって使用されます。通常、PagerSettings オブジェクトはコントロールの PagerSettings プロパティに格納されます。PagerSettings オブジェクトのプロパティを設定して、ページャをカスタマイズできます。
ページャは、さまざまな表示モードをサポートします。ページャを表示するモードを指定するには、Mode プロパティを設定します。各モードを次の表に示します。
NextPrevious | |
NextPreviousFirstLast | |
NumericFirstLast |
Mode プロパティが NextPrevious、NextPreviousFirstLast、または NumericFirstLast の各値に設定されている場合、次の表に示すプロパティを設定して、数値以外のボタンのテキストをカスタマイズできます。
FirstPageText | |
PreviousPageText | |
NextPageText | |
LastPageText |
次の表に示すプロパティを設定して、数値以外のボタンのイメージを表示することもできます。
FirstPageImageUrl | |
PreviousPageImageUrl | |
NextPageImageUrl | |
LastPageImageUrl |
![]() |
---|
イメージ プロパティが設定されている場合、対応するテキスト プロパティはイメージの代替テキストとして動作します。たとえば、FirstPageImageUrl プロパティが設定されている場合、FirstPageText プロパティによって指定されるテキストは、イメージの代替テキストとして表示されます。ツールヒントをサポートしているブラウザの場合、このテキストは対応するボタンのツールヒントとしても表示されます。 |
Mode プロパティが Numeric 値または NumericFirstLast 値に設定されている場合、PageButtonCount プロパティを設定して、ページャに表示するページ ボタンの数を指定できます。
ページャは、コントロールの上部、下部、または上部と下部の両方に表示できます。ページャの位置を指定するには、Position プロパティを設定します。ページャを表示または非表示にするには、Visible プロパティを使用します。

PagerSettings プロパティに格納されている PagerSettings オブジェクトを使用して、GridView コントロールのページ行に表示されるボタンのテキストをカスタマイズする方法を次のコード例に示します。
<%@ Page language="VB" %> <html> <body> <form runat="server"> <h3>PagerSetting Example</h3> <asp:gridview id="CustomerGridView" datasourceid="CustomerDataSource" autogeneratecolumns="true" datakeynames="CustomerID" allowpaging="true" runat="server"> <pagersettings mode="NextPreviousFirstLast" firstpagetext="First" lastpagetext="Last" nextpagetext="Next" previouspagetext="Prev" position="Bottom"/> </asp:gridview> <br/> <asp:label id="MessageLabel" forecolor="Red" runat="server"/> <!-- 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="CustomerDataSource" selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"/> </form> </body> </html>
<%@ Page language="C#" %> <html> <body> <form runat="server"> <h3>PagerSetting Example</h3> <asp:gridview id="CustomerGridView" datasourceid="CustomerDataSource" autogeneratecolumns="true" datakeynames="CustomerID" allowpaging="true" runat="server"> <pagersettings mode="NextPreviousFirstLast" firstpagetext="First" lastpagetext="Last" nextpagetext="Next" previouspagetext="Prev" position="Bottom"/> </asp:gridview> <br/> <asp:label id="MessageLabel" forecolor="Red" runat="server"/> <!-- 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="CustomerDataSource" selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"/> </form> </body> </html>

System.Web.UI.WebControls.PagerSettings


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PagerSettings メンバ
System.Web.UI.WebControls 名前空間
DetailsView クラス
DetailsView.AllowPaging プロパティ
DetailsView.PagerSettings プロパティ
FormView クラス
FormView.AllowPaging プロパティ
FormView.PagerSettings プロパティ
GridView クラス
GridView.AllowPaging プロパティ
GridView.PagerSettings プロパティ
Mode
FirstPageText
FirstPageImageUrl
PreviousPageText
PreviousPageImageUrl
NextPageText
LastPageText
LastPageImageUrl
PageButtonCount
Position
Visible
Weblioに収録されているすべての辞書からPagerSettings クラスを検索する場合は、下記のリンクをクリックしてください。

- PagerSettings クラスのページへのリンク