Share via


GridView.UseAccessibleHeader Özellik

Tanım

Bir denetimin üst bilgisini erişilebilir bir biçimde işleyip işlemediğini belirten bir GridView değer alır veya ayarlar. Bu özellik, denetimi yardımcı teknoloji cihazlarının kullanıcıları için daha erişilebilir hale getirmek için sağlanır.

public:
 virtual property bool UseAccessibleHeader { bool get(); void set(bool value); };
public virtual bool UseAccessibleHeader { get; set; }
member this.UseAccessibleHeader : bool with get, set
Public Overridable Property UseAccessibleHeader As Boolean

Özellik Değeri

trueGridView denetim üst bilgisini erişilebilir bir biçimde işlerse; değilse, false. Varsayılan değer: true.

Örnekler

Aşağıdaki örnekte, erişilebilir üst bilgiyi devre dışı bırakmak için özelliğinin nasıl kullanılacağı UseAccessibleHeader gösterilmektedir.


<%@ 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 UseAccessibleHeader Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridView UseAccessibleHeader Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowpaging="true"
        useaccessibleheader="false" 
        runat="server">
        
        <headerstyle backcolor="LightSteelBlue"
          font-names="Verdana"
          font-italic="true"
          font-size="12" 
          forecolor="Blue"/>
                        
      </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 UseAccessibleHeader Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridView UseAccessibleHeader Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowpaging="true"
        useaccessibleheader="false" 
        runat="server">
        
        <headerstyle backcolor="LightSteelBlue"
          font-names="Verdana"
          font-italic="true"
          font-size="12" 
          forecolor="Blue"/>
                        
      </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

Denetimin UseAccessibleHeader üst bilgi satırını erişilebilir bir biçimde işleyip işlemediğini GridView belirtmek için özelliğini kullanın. Bu özellik, denetimi yardımcı teknoloji cihazlarının kullanıcıları için daha erişilebilir hale getirmek için sağlanır. Varsayılan olarak, bu özelliğin değeridir true ve denetimin üst bilgisi tablo üst bilgisi hücre etiketleri kullanılarak <th> işlenir. Ayrıca, üst bilginin sütundaki tüm hücrelere uygulanacağını belirtmek için tablo üst bilgisine bir scope="col" öznitelik eklenir. Öğenin varsayılan işlemesi <th> korunur ve metin kalın ve yatay ortalanmış olarak işlenir. Geliştiriciler, basamaklı stil sayfası kullanarak öğenin stilini <th> geçersiz kılabilir.

Bu özelliğin değeri ise false, denetimin üst bilgisi tablo hücre etiketleri kullanılarak <td> işlenir.

Şunlara uygulanır

Ayrıca bkz.