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

Dim instance As PagerSettings Dim value As Boolean value = instance.Visible instance.Visible = value
/** @property */ public boolean get_Visible () /** @property */ public void set_Visible (boolean value)
ページャを表示する場合は true。それ以外の場合は false。既定値は true です。

Visible プロパティを使用して、改ページの自動修正をサポートするコントロールにページング コントロールが表示されるかどうかを指定します。ページング コントロールを非表示にするには、Visible プロパティを false に設定します。

Visible プロパティを使用して、GridView コントロールが編集モードのときにページ行を非表示にする方法を次のコード例に示します。
<%@ Page language="VB" %> <script runat="server"> Sub CustomerGridView_RowEditing(ByVal sender As Object, ByVal e As GridViewEditEventArgs) Handles CustomerGridView.RowEditing ' Hide the pager row. CustomerGridView.PagerSettings.Visible = False End Sub Sub CustomerGridView_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles CustomerGridView.RowCommand If e.CommandName = "Cancel" Or e.CommandName = "Update" Then ' Show the pager row. CustomerGridView.PagerSettings.Visible = True End If End Sub </script> <html> <body> <form runat="server"> <h3>PagerSetting Example</h3> <asp:gridview id="CustomerGridView" datasourceid="CustomerDataSource" autogeneratecolumns="true" datakeynames="CustomerID" allowpaging="true" autogenerateeditbutton="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]" updatecommand="Update [Customers] Set [CompanyName]=@CompanyName, [Address]=@Address, [City]=@City, [PostalCode]=@PostalCode, [Country]=@Country Where [CustomerID]=@CustomerID" connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" runat="server"/> </form> </body> </html>
<%@ Page language="C#" %> <script runat="server"> void CustomerGridView_RowEditing(Object sender, GridViewEditEventArgs e) { // Hide the pager row. CustomerGridView.PagerSettings.Visible = false; } void CustomerGridView_RowCommand(Object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Cancel" || e.CommandName == "Update") { // Show the pager row. CustomerGridView.PagerSettings.Visible = true; } } </script> <html> <body> <form runat="server"> <h3>PagerSetting Example</h3> <asp:gridview id="CustomerGridView" datasourceid="CustomerDataSource" autogeneratecolumns="true" datakeynames="CustomerID" allowpaging="true" autogenerateeditbutton="true" onrowediting="CustomerGridView_RowEditing" onrowcommand="CustomerGridView_RowCommand" 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]" updatecommand="Update [Customers] Set [CompanyName]=@CompanyName, [Address]=@Address, [City]=@City, [PostalCode]=@PostalCode, [Country]=@Country Where [CustomerID]=@CustomerID" 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.Visible プロパティのページへのリンク