CheckBoxField.Text Özellik

Tanım

Resim yazısını nesnedeki CheckBoxField her onay kutusunun yanında görüntülenecek şekilde alır veya ayarlar.

public:
 virtual property System::String ^ Text { System::String ^ get(); void set(System::String ^ value); };
public virtual string Text { get; set; }
member this.Text : string with get, set
Public Overridable Property Text As String

Özellik Değeri

içindeki her onay kutusunun CheckBoxFieldyanında görüntülenen resim yazısı. Varsayılan değer, boş dizedir ("").

Örnekler

Aşağıdaki kod örneği, bir denetimdeki nesnedeki TextGridView onay kutuları CheckBoxField için özel bir resim yazısı belirtmek üzere özelliğinin nasıl kullanılacağını gösterir.


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

      <asp:gridview id="AuthorsGridView" 
        datasourceid="AuthorsSqlDataSource" 
        autogeneratecolumns="False"
        runat="server">
                
        <columns>
                
          <asp:boundfield datafield="au_lname"
            headertext="Last Name"/>
                    
          <asp:checkboxfield datafield="contract"
            text="Contract"
            headertext="Contract"/>     
                
        </columns>
                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects -->
      <!-- to the Pubs sample database.                        -->
      <asp:sqldatasource id="AuthorsSqlDataSource"  
        selectcommand="SELECT [au_lname], [au_fname], [address], [city], [state], [zip], [contract] FROM [authors]"
        connectionstring="server=localhost;database=pubs;integrated security=SSPI"
        runat="server">
      </asp:sqldatasource>
            
    </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>CheckBoxField Example</title>
</head>
<body>
    <form id="form1" runat="server">
        
      <h3>CheckBoxField Example</h3>

      <asp:gridview id="AuthorsGridView" 
        datasourceid="AuthorsSqlDataSource" 
        autogeneratecolumns="False"
        runat="server">
                
        <columns>
                
          <asp:boundfield datafield="au_lname"
            headertext="Last Name"/>
                    
          <asp:checkboxfield datafield="contract"
            text="Contract"
            headertext="Contract"/>     
                
        </columns>
                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects -->
      <!-- to the Pubs sample database.                        -->
      <asp:sqldatasource id="AuthorsSqlDataSource"  
        selectcommand="SELECT [au_lname], [au_fname], [address], [city], [state], [zip], [contract] FROM [authors]"
        connectionstring="server=localhost;database=pubs;integrated security=SSPI"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

Açıklamalar

Text özelliği, nesnedeki her onay kutusunun yanında bir CheckBoxField resim yazısı görüntülemek için kullanılır. Text özelliği boş bir dizeye ayarlanırsa, resim yazısı görüntülenmez.

Not

Nesnedeki CheckBoxField tüm onay kutuları aynı resim yazısını paylaşır.

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.