GridView.Caption Özellik

Tanım

Denetimin HTML resim yazısı öğesinde GridView işlenmek üzere metni 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 System::String ^ Caption { System::String ^ get(); void set(System::String ^ value); };
public virtual string Caption { get; set; }
member this.Caption : string with get, set
Public Overridable Property Caption As String

Özellik Değeri

String

Bir denetimdeki HTML resim yazısı öğesinde işlenmek üzere metni temsil eden dize GridView . Varsayılan değer boş bir dizedir ("").

Örnekler

Aşağıdaki örnekte, denetimin resim yazısını Caption belirtmek için GridView özelliğinin nasıl kullanılacağı 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 Caption and CaptionAlign Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridView Caption and CaptionAlign Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowpaging="true"
        caption="Customer Information Table"
        captionalign="Top"   
        runat="server">                
      </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 Caption and CaptionAlign Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>GridView Caption and CaptionAlign Example</h3>

      <asp:gridview id="CustomersGridView" 
        datasourceid="CustomersSource" 
        autogeneratecolumns="true"
        emptydatatext="No data available." 
        allowpaging="true"
        caption="Customer Information Table"
        captionalign="Top"   
        runat="server">                
      </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 Caption HTML resim yazısı öğesinde GridView işılacak metni belirtmek için özelliğini kullanın. Belirttiğiniz metin, yardımcı teknoloji cihazlarına denetimi daha erişilebilir hale getirmek için kullanılabilecek tablonun açıklamasını sağlar. Özelliğini kullanarak CaptionAlign HTML açıklamalı alt yazı öğesinin işlendiği konumu da belirtebilirsiniz.

Bu özelliğin değeri ayarlandığında, bir tasarımcı aracı kullanılarak otomatik olarak bir kaynak dosyasına kaydedilebilir. Daha fazla bilgi için bkz LocalizableAttribute . ve Genelleştirme ve Yerelleştirme.

Şunlara uygulanır

Ayrıca bkz.