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

1 ページに表示されるレコード数。既定値は 10 です。


(AllowPaging プロパティを true に設定することによって) ページング機能が有効になっている場合、PageSize プロパティを使用して、1 ページに表示されるレコード数を指定します。
Topic | Location |
---|---|
方法 : GridView Web サーバー コントロールで既定のページングを有効にする | Visual Studio での ASP .NET Web アプリケーションの作成 |

PageSize プロパティを使用して、GridView コントロールに一度に 15 個のレコードを表示する方法を次のコード例に示します。
<%@ Page language="VB" %> <html> <body> <form runat="server"> <h3>GridView PageSize Example</h3> <asp:gridview id="CustomersGridView" datasourceid="CustomersSource" autogeneratecolumns="true" emptydatatext="No data available." allowpaging="true" pagesize="15" runat="server"> </asp:gridview> <!-- 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="CustomersSource" 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>GridView PageSize Example</h3> <asp:gridview id="CustomersGridView" datasourceid="CustomersSource" autogeneratecolumns="true" emptydatatext="No data available." allowpaging="true" pagesize="15" runat="server"> </asp:gridview> <!-- 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="CustomersSource" 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


GridView クラス
GridView メンバ
System.Web.UI.WebControls 名前空間
System.Web.UI.WebControls.PagerSettings
System.Web.UI.WebControls.TableItemStyle
GridView.AllowPaging プロパティ
GridView.PageCount プロパティ
GridView.PageIndex プロパティ
GridView.PagerSettings プロパティ
GridView.PagerStyle プロパティ
GridView.PagerTemplate プロパティ
PageIndexChanged
PageIndexChanging
Weblioに収録されているすべての辞書からGridView.PageSize プロパティを検索する場合は、下記のリンクをクリックしてください。

- GridView.PageSize プロパティのページへのリンク