GridView.PagerSettings 속성

정의

PagerSettings 컨트롤의 페이저 단추 속성을 설정하는 데 사용할 수 있는 GridView 개체에 대한 참조를 가져옵니다.

public:
 virtual property System::Web::UI::WebControls::PagerSettings ^ PagerSettings { System::Web::UI::WebControls::PagerSettings ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public virtual System.Web.UI.WebControls.PagerSettings PagerSettings { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.PagerSettings : System.Web.UI.WebControls.PagerSettings
Public Overridable ReadOnly Property PagerSettings As PagerSettings

속성 값

PagerSettings

PagerSettings 컨트롤의 페이저 단추 속성을 설정하는 데 사용할 수 있는 GridView에 대한 참조입니다.

특성

예제

다음 예제에서는 선언적으로 속성을 설정 PagerSettings 하는 방법을 보여 줍니다. 호출기 행의 글꼴과 배경을 각각 파란색과 연한 파랑으로 설정합니다.


<%@ Page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>GridView AllowPaging Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridView AllowPaging Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowpaging="true" 
        runat="server">
                
        <pagersettings mode="Numeric"
          position="Bottom"           
          pagebuttoncount="10"/>
                      
        <pagerstyle backcolor="LightBlue"
          height="30px"
          verticalalign="Bottom"
          horizontalalign="Center"/>
                
      </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="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>GridView AllowPaging Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridView AllowPaging Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowpaging="true" 
        runat="server">
                
        <pagersettings mode="Numeric"
          position="Bottom"           
          pagebuttoncount="10"/>
                      
        <pagerstyle backcolor="LightBlue"
          height="30px"
          verticalalign="Bottom"
          horizontalalign="Center"/>
                
      </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>

설명

속성을 PagerSettings 사용하여 컨트롤의 호출기 행 설정을 제어합니다 GridView . 페이징 기능을 사용할 때(속성을 true설정 AllowPaging 하여) 페이징 행이 표시되고 사용자가 컨트롤의 다른 페이지로 이동할 수 있는 컨트롤이 포함됩니다. 이 속성은 읽기 전용입니다. 그러나의 속성을 설정할 수는 PagerSettings 개체를 반환 합니다. 속성은 다음 메서드 중 하나를 사용하여 선언적으로 설정할 수 있습니다.

  • 개체의 속성(예PagerSettings-Mode: )인 폼 Subproperty Property-Subproperty에서 컨트롤의 GridView 여는 태그에 PagerSettings 특성을 배치합니다.

  • <PagerSettings> 컨트롤의 여는 태그와 닫는 태그 사이에 요소를 중 GridView 첩합니다.

형식에서 속성을 프로그래밍 방식으로 설정할 수도 있습니다 Property.Subproperty (예를 들어 PagerStyle.Mode). 일반적인 설정에는 일반적으로 탐색 컨트롤에 대한 호출기 행의 표시 모드와 사용자 지정 텍스트 또는 이미지가 포함됩니다.

적용 대상

추가 정보