GridView.PagerStyle Özellik

Tanım

Bir denetimde TableItemStyle disk belleği satırının görünümünü ayarlamanıza olanak tanıyan nesneye başvuru GridView alır.

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

Özellik Değeri

Bir denetimdeki TableItemStyle disk belleği satırının stilini temsil eden öğesine başvuru GridView .

Öznitelikler

Örnekler

Aşağıdaki örnekte özelliğin PagerStyle bildirim temelli olarak nasıl ayarlanacağı gösterilmektedir. Çağrı tipi satırının yazı tipini ve arka planını 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

Özelliği, PagerStyle bir GridView denetimde disk belleği satırının görünümünü denetlemek için 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 TableItemStyle özelliklerini ayarlayabilirsiniz. Özellikler, aşağıdaki yöntemlerden biri kullanılarak bildirim temelli olarak ayarlanabilir:

  • formda denetimin GridView açma etiketine bir öznitelik yerleştirin; burada Subproperty nesnenin TableItemStyle bir özelliğidir (örneğin, PagerStyle-ForeColor).Property-Subproperty

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

Özellikler, formda Property.Subproperty program aracılığıyla da ayarlanabilir (örneğin, PagerStyle.ForeColor). Genel ayarlar genellikle özel bir arka plan rengi, ön plan rengi ve yazı tipi özelliklerini içerir.

Şunlara uygulanır

Ayrıca bkz.