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

/** @property */ public PagerButtons get_Mode () /** @property */ public void set_Mode (PagerButtons value)
PagerButtons 値の 1 つ。既定値は PagerButtons.Numeric です。


改ページ位置の自動修正をサポートするコントロールには、ページング コントロールを表示する複数のモードが用意されています。モードを指定するには、Mode プロパティを使用します。ページ編集コントロールの各モードを次の表に示します。
NextPrevious | |
NextPreviousFirstLast | |
NumericFirstLast |
Mode プロパティが NextPrevious、NextPreviousFirstLast、または NumericFirstLast の各値に設定されている場合、次の表に示すプロパティを設定して、数値以外のボタンのカスタム テキストを指定できます。
FirstPageText | |
PreviousPageText | |
NextPageText | |
LastPageText |
次の表に示すプロパティを設定して、数値以外のボタンのイメージを表示することもできます。
FirstPageImageUrl | |
PreviousPageImageUrl | |
NextPageImageUrl | |
LastPageImageUrl |

Mode プロパティを使用して、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="NumericFirstLast" firstpagetext="First" lastpagetext="Last" pagebuttoncount="5" 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="NumericFirstLast" firstpagetext="First" lastpagetext="Last" pagebuttoncount="5" 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>

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.Mode プロパティのページへのリンク