GridView.PagerSettings Özellik

Tanım

Bir denetimdeki PagerSettings çağrı aracı düğmelerinin özelliklerini ayarlamanıza olanak tanıyan nesneye başvuru GridView alır.

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

Özellik Değeri

PagerSettings

Bir denetimdeki PagerSettings disk belleği düğmelerinin özelliklerini ayarlamanıza olanak tanıyan öğesine GridView başvuru.

Öznitelikler

Örnekler

Aşağıdaki örnekte özelliğin PagerSettings bildirim temelli olarak nasıl ayarlanacağı gösterilmektedir. Çağrı satırı için yazı tipini ve arka planı sırasıyla mavi ve açık mavi olarak ayarlar.


<%@ 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>

Açıklamalar

Bir denetimdeki PagerSettings disk belleği satırının GridView ayarlarını denetlemek için özelliğini kullanın. Disk belleği özelliği etkinleştirildiğinde (özelliği trueolarak ayarlanarakAllowPaging) disk belleği satırı görüntülenir ve kullanıcının denetimdeki farklı sayfalara gitmesine izin veren denetimleri içerir. Bu özellik salt okunurdur; ancak, döndürdüğü nesnenin PagerSettings özelliklerini ayarlayabilirsiniz. Özellikler, aşağıdaki yöntemlerden biri kullanılarak bildirim temelli olarak ayarlanabilir:

  • Bir özniteliği, denetimin açma etiketine GridView biçiminde Property-Subpropertyyerleştirin; burada Subproperty nesnenin PagerSettings bir özelliğidir (örneğin, PagerSettings-Mode).

  • Bir <PagerSettings> öğeyi denetimin açma ve kapatma etiketleri arasında iç içe yerleştirme GridView .

Özellikler, biçiminde Property.Subproperty program aracılığıyla da ayarlanabilir (örneğin, PagerStyle.Mode). Yaygın ayarlar genellikle disk belleği satırının görüntüleme modunu ve gezinti denetimleri için özel metin veya görüntüleri içerir.

Şunlara uygulanır

Ayrıca bkz.