TemplateFieldとは? わかりやすく解説

TemplateField クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

データ バインド コントロールカスタム内容表示するフィールド表します

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Class TemplateField
    Inherits DataControlField
Dim instance As TemplateField
public class TemplateField : DataControlField
public ref class TemplateField : public
 DataControlField
public class TemplateField extends DataControlField
public class TemplateField extends
 DataControlField
解説解説

データ バインド コントロール (GridView、DetailsView など) はこの TemplateField クラス使用して表示されるレコードカスタム内容表示しますいずれかの定義済みデータ コントロール フィールド (BoundField など) で提供されないデータ バインド コントロール内容表示する場合は、TemplateField クラス使用してカスタム ユーザー インターフェイス (UI: User Interface) を作成しますTemplateField オブジェクトは、それが使用されているデータ バインド コントロールによって表示異なります。たとえば、TemplateField オブジェクトは、GridView コントロールでは列として表示されDetailsView コントロールでは行として表示されます。

次の表に示すテンプレート使用してTemplateField オブジェクトさまざまな部分についてカスタム テンプレートを定義できます

テンプレート

説明

AlternatingItemTemplate

TemplateField オブジェクト交互の項目に表示する内容指定します

EditItemTemplate

TemplateField オブジェクト編集モードの項目に表示する内容指定します

FooterTemplate

TemplateField オブジェクトフッター セクション表示する内容指定します

HeaderTemplate

TemplateField オブジェクトヘッダー セクション表示する内容指定します

InsertItemTemplate

TemplateField オブジェクト挿入モードの項目に表示する内容指定します。このテンプレートは、DetailsView コントロールだけでサポートされます。

ItemTemplate

TemplateField オブジェクトの項目に表示する内容指定します

データ バインド コントロール内の TemplateField オブジェクトを非表示にするには、Visible プロパティfalse設定します

カスタムHeaderTemplate テンプレートまたは FooterTemplate テンプレート定義する代わりにTemplateField オブジェクトの他のプロパティ設定してTemplateField オブジェクトヘッダー セクションフッター セクションカスタマイズできますヘッダー セクションキャプション表示するには、HeaderText プロパティ設定しますフッター セクションキャプション表示するには、FooterText プロパティ設定しますヘッダー セクションテキスト表示する代わりに、HeaderImageUrl プロパティ設定してイメージ表示できます。ShowHeader プロパティfalse設定することにより、TemplateField オブジェクトヘッダー セクションを非表示できます

また、フィールド各部分にスタイル プロパティ設定すると、TemplateField オブジェクト外観 (フォントの色や背景色など) をカスタマイズできますさまざまなスタイル プロパティの一覧を次の表に示します

使用例使用例

2 つフィールドを同じセル表示するカスタムTemplateField オブジェクト作成するコード例次に示します最初の名前フィールド最後の名前フィールドは、同じ TemplateField オブジェクト結合されます。

<%@ Page language="VB" %>

<html>
  <body>
    <form runat="server">
        
      <h3>TemplateField Example</h3>

      <!-- Populate the Columns collection declaratively. -->
      <!-- Create a custom TemplateField column that uses      -->
      <!-- two Label controls to display an author's
 first and -->
      <!-- last name in the same column.                  
     -->
      <asp:gridview id="AuthorsGridView" 
        datasourceid="AuthorsSqlDataSource" 
        autogeneratecolumns="False"
        runat="server">
                
        <columns>
                
          <asp:templatefield headertext="Author Name">
            <itemtemplate>
              <asp:label id="FirstNameLabel"
                text= '<%# Eval("au_fname") %>'
                runat="server"/> 
              <asp:label id="LastNameLabel"
                text= '<%# Eval("au_lname") %>'
                runat="server"/>
            </itemtemplate>
          </asp:templatefield>
                
        </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="C#" %>

<html>
  <body>
    <form runat="server">
        
      <h3>TemplateField Example</h3>

      <!-- Populate the Columns collection declaratively. -->
      <!-- Create a custom TemplateField column that uses      -->
      <!-- two Label controls to display an author's first and -->
      <!-- last name in the same column.                  
     -->
      <asp:gridview id="AuthorsGridView" 
        datasourceid="AuthorsSqlDataSource" 
        autogeneratecolumns="False"
        runat="server">
                
        <columns>
                
          <asp:templatefield headertext="Author Name">
            <itemtemplate>
              <asp:label id="FirstNameLabel"
                Text= '<%# Eval("au_fname") %>'
                runat="server"/> 
              <asp:label id="LastNameLabel"
                Text= '<%# Eval("au_lname") %>'
                runat="server"/>
            </itemtemplate>
          </asp:templatefield>
                
        </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>

.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.Web.UI.WebControls.DataControlField
    System.Web.UI.WebControls.TemplateField
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TemplateField メンバ
System.Web.UI.WebControls 名前空間
GridView クラス
GridView.Columns プロパティ
DetailsView クラス
DetailsView.Fields プロパティ
BoundField クラス
ButtonField クラス
CheckBoxField クラス
CommandField クラス
DataControlField クラス
HyperLinkField クラス
AlternatingItemTemplate
EditItemTemplate
FooterTemplate
HeaderTemplate
InsertItemTemplate
ItemTemplate
DataControlField.Visible プロパティ

TemplateField コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0新しく追加されたものです。

TemplateField クラス新しインスタンス初期化します。

名前空間: System.Web.UI.WebControls
アセンブリ: System.Web (system.web.dll 内)
構文構文

public TemplateField ()
public:
TemplateField ()
public TemplateField ()
public function TemplateField ()
解説解説
使用例使用例

コンストラクタ使用してTemplateField フィールド列を GridView コントロール動的に追加する方法次のコード例示します

<%@ Page language="VB" %>

<script runat="server">
  
  ' Create a template class to represent a dynamic template column.
  Public Class GridViewTemplate   
    Implements ITemplate

    Private templateType As DataControlRowType
    Private columnName As String
   
    Sub New(ByVal type As
 DataControlRowType, ByVal colname As String)

      templateType = type
      columnName = colname
    
    End Sub

    Sub InstantiateIn(ByVal container As
 System.Web.UI.Control) _
      Implements ITemplate.InstantiateIn
      
      ' Create the content for the different row types.
      Select Case templateType

        Case DataControlRowType.Header
          ' Create the controls to put in the header
          ' section and set their properties.
          Dim lc As New
 Literal
          lc.Text = "<B>" & columnName &
 "</B>"
          
          ' Add the controls to the Controls collection
          ' of the container.
          container.Controls.Add(lc)

        Case DataControlRowType.DataRow
          ' Create the controls to put in a data row
          ' section and set their properties.
          Dim firstName As New
 Label
          Dim lastName As New
 Label
          
          Dim spacer = New Literal
          spacer.Text = " "
          
          ' To support data binding, register the event-handling methods
          ' to perform the data binding. Each control needs its own
 event
          ' handler.
          AddHandler firstName.DataBinding, AddressOf
 FirstName_DataBinding
          AddHandler lastName.DataBinding, AddressOf
 LastName_DataBinding
          
          ' Add the controls to the Controls collection
          ' of the container.
          container.Controls.Add(firstName)
          container.Controls.Add(spacer)
          container.Controls.Add(lastName)
          
          ' Insert cases to create the content for the other 
          ' row types, if desired.
          
        Case Else
        
          ' Insert code to handle unexpected values. 
          
      End Select
      
    End Sub
    
    Private Sub FirstName_DataBinding(ByVal
 sender As Object, ByVal
 e As EventArgs)

      ' Get the Label control to bind the value. The Label control
      ' is contained in the object that raised the DataBinding 
      ' event (the sender parameter).
      Dim l As Label = CType(sender, Label)
      
      ' Get the GridViewRow object that contains the Label control.
 
      Dim row As GridViewRow = CType(l.NamingContainer,
 GridViewRow)
      
      ' Get the field value from the GridViewRow object and 
      ' assign it to the Text property of the Label control.
      l.Text = DataBinder.Eval(row.DataItem, "au_fname").ToString()
    
    End Sub
    
    Private Sub LastName_DataBinding(ByVal
 sender As Object, ByVal
 e As EventArgs)
 
      ' Get the Label control to bind the value. The Label control
      ' is contained in the object that raised the DataBinding 
      ' event (the sender parameter).
      Dim l As Label = CType(sender, Label)
      
      ' Get the GridViewRow object that contains the Label control.
      Dim row As GridViewRow = CType(l.NamingContainer,
 GridViewRow)
      
      ' Get the field value from the GridViewRow object and 
      ' assign it to the Text property of the Label control.
      l.Text = DataBinder.Eval(row.DataItem, "au_lname").ToString()
    
    End Sub
    
  End Class

  Sub Page_Load(ByVal sender As
 Object, ByVal e As EventArgs)
    
    ' The field columns need to be created only when the page is
    ' first loaded. 
    If Not IsPostBack Then
      ' Dynamically create field columns to display the desired
      ' fields from the data source. Create a TemplateField object 
      ' to display an author's first and last name.
      Dim customField As New
 TemplateField

      ' Create the dynamic templates and assign them to
      ' the appropriate template property.
      customField.ItemTemplate = New GridViewTemplate(DataControlRowType.DataRow,
 "Author Name")
      customField.HeaderTemplate = New GridViewTemplate(DataControlRowType.Header,
 "Author Name")

      ' Add the field column to the Columns collection of the
      ' GridView control.
      AuthorsGridView.Columns.Add(customField)
    End If
  
  End Sub

</script>

<html>
  <body>
    <form runat="server">
        
      <h3>TemplateField Constructor Example</h3>

      <asp:gridview id="AuthorsGridView" 
        datasourceid="AuthorsSqlDataSource" 
        autogeneratecolumns="False"
        runat="server">                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects
 -->
      <!-- to the Pubs sample database.                   
     -->
      <asp:sqldatasource id="AuthorsSqlDataSource"
  
        selectcommand="SELECT [au_fname], [au_lname] FROM [authors]"
        connectionstring="server=localhost;database=pubs;integrated
 security=SSPI"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

<%@ Page language="C#" %>

<script runat="server">
  
  // Create a template class to represent a dynamic template column.
  public class GridViewTemplate : ITemplate
  {
    private DataControlRowType templateType;
    private string columnName;
   
    public GridViewTemplate(DataControlRowType type, string
 colname)
    {
      templateType = type;
      columnName = colname;
    }

    public void InstantiateIn(System.Web.UI.Control
 container)
    {
      // Create the content for the different row types.
      switch(templateType)
      {
        case DataControlRowType.Header:
          // Create the controls to put in the header
          // section and set their properties.
          Literal lc = new Literal();
          lc.Text = "<B>" + columnName + "</B>";
          
          // Add the controls to the Controls collection
          // of the container.
          container.Controls.Add(lc);
          break;
        case DataControlRowType.DataRow:
          // Create the controls to put in a data row
          // section and set their properties.
          Label firstName = new Label();
          Label lastName = new Label();
          
          Literal spacer = new Literal();
          spacer.Text = " ";
          
          // To support data binding, register the event-handling methods
          // to perform the data binding. Each control needs its own
 event
          // handler.
          firstName.DataBinding += new EventHandler(this.FirstName_DataBinding);
          lastName.DataBinding += new EventHandler(this.LastName_DataBinding);
          
          // Add the controls to the Controls collection
          // of the container.
          container.Controls.Add(firstName);
          container.Controls.Add (spacer);
          container.Controls.Add(lastName);
          break;
          
        // Insert cases to create the content for the other 
        // row types, if desired.
          
        default:
          // Insert code to handle unexpected values.
          break; 
      }
    }
    
    private void FirstName_DataBinding(Object
 sender, EventArgs e)
    {
      // Get the Label control to bind the value. The Label control
      // is contained in the object that raised the DataBinding 
      // event (the sender parameter).
      Label l = (Label)sender;
      
      // Get the GridViewRow object that contains the Label control.
 
      GridViewRow row = (GridViewRow)l.NamingContainer;
      
      // Get the field value from the GridViewRow object and 
      // assign it to the Text property of the Label control.
      l.Text = DataBinder.Eval(row.DataItem, "au_fname").ToString();
    }
    
    private void LastName_DataBinding(Object
 sender, EventArgs e)
    { 
      // Get the Label control to bind the value. The Label control
      // is contained in the object that raised the DataBinding 
      // event (the sender parameter).
      Label l = (Label)sender;
      
      // Get the GridViewRow object that contains the Label control.
      GridViewRow row = (GridViewRow)l.NamingContainer;
      
      // Get the field value from the GridViewRow object and 
      // assign it to the Text property of the Label control.
      l.Text = DataBinder.Eval(row.DataItem, "au_lname").ToString();
    }
  }

  void Page_Load(Object sender, EventArgs e)
  {
    
    // The field columns need to be created only when the page is
    // first loaded. 
    if (!IsPostBack)
    {
      // Dynamically create field columns to display the desired
      // fields from the data source. Create a TemplateField object
 
      // to display an author's first and last name.
      TemplateField customField = new TemplateField();

      // Create the dynamic templates and assign them to 
      // the appropriate template property.
      customField.ItemTemplate = new GridViewTemplate(DataControlRowType.DataRow,
 "Author Name");
      customField.HeaderTemplate = new GridViewTemplate(DataControlRowType.Header,
 "Author Name");

      // Add the field column to the Columns collection of the
      // GridView control.
      AuthorsGridView.Columns.Add(customField);
    }
  
  }

</script>

<html>
  <body>
    <form runat="server">
        
      <h3>TemplateField Constructor Example</h3>

      <asp:gridview id="AuthorsGridView" 
        datasourceid="AuthorsSqlDataSource" 
        autogeneratecolumns="False"
        runat="server">                
      </asp:gridview>
            
      <!-- This example uses Microsoft SQL Server and connects -->
      <!-- to the Pubs sample database.                        -->
      <asp:sqldatasource id="AuthorsSqlDataSource"  
        selectcommand="SELECT [au_fname], [au_lname] FROM [authors]"
        connectionstring="server=localhost;database=pubs;integrated security=SSPI"
        runat="server">
      </asp:sqldatasource>
            
    </form>
  </body>
</html>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TemplateField クラス
TemplateField メンバ
System.Web.UI.WebControls 名前空間
GridView クラス
GridView.Columns プロパティ
DetailsView クラス
DetailsView.Fields プロパティ

TemplateField プロパティ


パブリック プロパティパブリック プロパティ

( プロテクト プロパティ参照)
  名前 説明
パブリック プロパティ AccessibleHeaderText  一部コントロールAbbreviatedText プロパティ値として表示されるテキスト取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ AlternatingItemTemplate TemplateField オブジェクト交互の項目を表示するときに使用するテンプレート取得または設定します
パブリック プロパティ ControlStyle  DataControlField オブジェクト格納されているすべての Web サーバー コントロールスタイル取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ ConvertEmptyStringToNull TemplateField オブジェクトバインドする値が Empty である場合にこの値を null 参照 (Visual Basic では Nothing) に変換するかどうかを示す値を取得または設定します
パブリック プロパティ EditItemTemplate TemplateField オブジェクト編集モードの項目を表示するときに使用するテンプレート取得または設定します
パブリック プロパティ FooterStyle  データ コントロール フィールドフッタースタイル取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ FooterTemplate TemplateField オブジェクトフッター セクション表示するときに使用するテンプレート取得または設定します
パブリック プロパティ FooterText  データ コントロール フィールドフッター項目に表示されるテキスト取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ HeaderImageUrl  データ コントロール フィールドヘッダー項目に表示されるイメージURL取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ HeaderStyle  データ コントロール フィールドヘッダースタイル取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ HeaderTemplate TemplateField オブジェクトヘッダー セクション表示するときに使用するテンプレート取得または設定します
パブリック プロパティ HeaderText  データ コントロール フィールドヘッダー項目に表示されるテキスト取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ InsertItemTemplate TemplateField オブジェクト挿入モードの項目を表示するときに使用するテンプレート取得または設定します
パブリック プロパティ InsertVisible  DataControlField オブジェクトの親データ バインド コントロール挿入モード場合に、このオブジェクト表示されるかどうかを示す値を取得します。 ( DataControlField から継承されます。)
パブリック プロパティ ItemStyle  データ コントロール フィールド表示されるテキスト ベース内容スタイル取得します。 ( DataControlField から継承されます。)
パブリック プロパティ ItemTemplate データ バインド コントロールの項目を表示するときに使用するテンプレート取得または設定します
パブリック プロパティ ShowHeader  データ コントロール フィールドヘッダー項目を表示するかどうかを示す値を取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ SortExpression  データ ソース コントロールデータ並べ替えるために使用される並べ替え式を、取得または設定します。 ( DataControlField から継承されます。)
パブリック プロパティ Visible  データ コントロール フィールド表示するかどうかを示す値を取得または設定します。 ( DataControlField から継承されます。)
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ Control  DataControlField オブジェクト関連付けられているデータ コントロール参照取得します。 ( DataControlField から継承されます。)
プロテクト プロパティ DesignMode  デザイン環境で、現在データ コントロール フィールド表示されているかどうかを示す値を取得します。 ( DataControlField から継承されます。)
プロテクト プロパティ IsTrackingViewState  DataControlField オブジェクトビューステートへの変更保存しているかどうかを示す値を取得します。 ( DataControlField から継承されます。)
プロテクト プロパティ ViewState  同一ページ対す複数要求わたってDataControlField オブジェクトビューステート保存し復元できるようにする状態情報のディクショナリを取得します。 ( DataControlField から継承されます。)
参照参照

関連項目

TemplateField クラス
System.Web.UI.WebControls 名前空間
GridView クラス
GridView.Columns プロパティ
DetailsView クラス
DetailsView.Fields プロパティ
BoundField クラス
ButtonField クラス
CheckBoxField クラス
CommandField クラス
DataControlField クラス
HyperLinkField クラス
AlternatingItemTemplate
EditItemTemplate
FooterTemplate
HeaderTemplate
InsertItemTemplate
ItemTemplate
DataControlField.Visible プロパティ

TemplateField メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 ( Object から継承されます。)
パブリック メソッド ExtractValuesFromCell オーバーライドされます1 つ上の双方向バインディング ステートメント (DataBind) で指定されたとおりに、現在のテーブル セルからデータ コントロール フィールドの値を抽出して指定された IOrderedDictionary コレクションに値を追加します
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 ( Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド Initialize  データ コントロール フィールドインスタンス基本的な初期化実行します。 ( DataControlField から継承されます。)
パブリック メソッド InitializeCell オーバーライドされますセルコントロールコレクションテキストまたはコントロール追加します
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  この DataControlField オブジェクトを表す文字列を返します。 ( DataControlField から継承されます。)
パブリック メソッド ValidateSupportsCallback オーバーライドされます。 TemplateField オブジェクト格納されているコントロールページコールバックサポートしているかどうか確認します
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド CloneField  現在の DataControlField 派生オブジェクトコピー作成します。 ( DataControlField から継承されます。)
プロテクト メソッド CopyProperties オーバーライドされます現在の TemplateField 派生オブジェクトプロパティを、指定されDataControlField オブジェクトコピーします
プロテクト メソッド CreateField オーバーライドされます新しTemplateField オブジェクト作成します
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 ( Object から継承されます。)
プロテクト メソッド LoadViewState  データ ソース ビューの、以前保存したビューステート復元します。 ( DataControlField から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 ( Object から継承されます。)
プロテクト メソッド OnFieldChanged  FieldChanged イベント発生させます。 ( DataControlField から継承されます。)
プロテクト メソッド SaveViewState  ページサーバーポストバックされた時間以降発生したDataControlField ビューステートへの変更保存します。 ( DataControlField から継承されます。)
プロテクト メソッド TrackViewState  DataControlField オブジェクトがそのビューステート変更追跡するようにします。それにより、変更コントロールViewState プロパティ格納して、同じページ対す複数要求わたって永続化できます。 ( DataControlField から継承されます。)
参照参照

関連項目

TemplateField クラス
System.Web.UI.WebControls 名前空間
GridView クラス
GridView.Columns プロパティ
DetailsView クラス
DetailsView.Fields プロパティ
BoundField クラス
ButtonField クラス
CheckBoxField クラス
CommandField クラス
DataControlField クラス
HyperLinkField クラス
AlternatingItemTemplate
EditItemTemplate
FooterTemplate
HeaderTemplate
InsertItemTemplate
ItemTemplate
DataControlField.Visible プロパティ

TemplateField メンバ

データ バインド コントロールカスタム内容表示するフィールド表します

TemplateField データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド TemplateField TemplateField クラス新しインスタンス初期化します。
パブリック プロパティパブリック プロパティ
( プロテクト プロパティ参照)
  名前 説明
パブリック プロパティ AccessibleHeaderText  一部コントロールAbbreviatedText プロパティ値として表示されるテキスト取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ AlternatingItemTemplate TemplateField オブジェクト交互の項目を表示するときに使用するテンプレート取得または設定します
パブリック プロパティ ControlStyle  DataControlField オブジェクト格納されているすべての Web サーバー コントロールスタイル取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ ConvertEmptyStringToNull TemplateField オブジェクトバインドする値が Empty である場合にこの値を null 参照 (Visual Basic では Nothing) に変換するかどうかを示す値を取得または設定します
パブリック プロパティ EditItemTemplate TemplateField オブジェクト編集モードの項目を表示するときに使用するテンプレート取得または設定します
パブリック プロパティ FooterStyle  データ コントロール フィールドフッタースタイル取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ FooterTemplate TemplateField オブジェクトフッター セクション表示するときに使用するテンプレート取得または設定します
パブリック プロパティ FooterText  データ コントロール フィールドフッター項目に表示されるテキスト取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ HeaderImageUrl  データ コントロール フィールドヘッダー項目に表示されるイメージURL取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ HeaderStyle  データ コントロール フィールドヘッダースタイル取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ HeaderTemplate TemplateField オブジェクトヘッダー セクション表示するときに使用するテンプレート取得または設定します
パブリック プロパティ HeaderText  データ コントロール フィールドヘッダー項目に表示されるテキスト取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ InsertItemTemplate TemplateField オブジェクト挿入モードの項目を表示するときに使用するテンプレート取得または設定します
パブリック プロパティ InsertVisible  DataControlField オブジェクトの親データ バインド コントロール挿入モード場合に、このオブジェクト表示されるかどうかを示す値を取得します。(DataControlField から継承されます。)
パブリック プロパティ ItemStyle  データ コントロール フィールド表示されるテキスト ベース内容スタイル取得します。(DataControlField から継承されます。)
パブリック プロパティ ItemTemplate データ バインド コントロールの項目を表示するときに使用するテンプレート取得または設定します
パブリック プロパティ ShowHeader  データ コントロール フィールドヘッダー項目を表示するかどうかを示す値を取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ SortExpression  データ ソース コントロールデータ並べ替えるために使用される並べ替え式を、取得または設定します。(DataControlField から継承されます。)
パブリック プロパティ Visible  データ コントロール フィールド表示するかどうかを示す値を取得または設定します。(DataControlField から継承されます。)
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ Control  DataControlField オブジェクト関連付けられているデータ コントロール参照取得します。(DataControlField から継承されます。)
プロテクト プロパティ DesignMode  デザイン環境で、現在データ コントロール フィールド表示されているかどうかを示す値を取得します。(DataControlField から継承されます。)
プロテクト プロパティ IsTrackingViewState  DataControlField オブジェクトビューステートへの変更保存しているかどうかを示す値を取得します。(DataControlField から継承されます。)
プロテクト プロパティ ViewState  同一ページ対す複数要求わたってDataControlField オブジェクトビューステート保存し復元できるようにする状態情報のディクショナリを取得します。(DataControlField から継承されます。)
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 (Object から継承されます。)
パブリック メソッド ExtractValuesFromCell オーバーライドされます1 つ上の双方向バインディング ステートメント (DataBind) で指定されたとおりに、現在のテーブル セルからデータ コントロール フィールドの値を抽出して指定された IOrderedDictionary コレクションに値を追加します
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 (Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド Initialize  データ コントロール フィールドインスタンス基本的な初期化実行します。 (DataControlField から継承されます。)
パブリック メソッド InitializeCell オーバーライドされますセルコントロールコレクションテキストまたはコントロール追加します
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  この DataControlField オブジェクトを表す文字列を返します。 (DataControlField から継承されます。)
パブリック メソッド ValidateSupportsCallback オーバーライドされますTemplateField オブジェクト格納されているコントロールページコールバックサポートしているかどうか確認します
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド CloneField  現在の DataControlField 派生オブジェクトコピー作成します。 (DataControlField から継承されます。)
プロテクト メソッド CopyProperties オーバーライドされます現在の TemplateField 派生オブジェクトプロパティを、指定されDataControlField オブジェクトコピーします
プロテクト メソッド CreateField オーバーライドされます新しTemplateField オブジェクト作成します
プロテクト メソッド Finalize  Objectガベージ コレクションにより収集される前に、その Objectリソース解放しその他のクリーンアップ操作実行できるようにします。 (Object から継承されます。)
プロテクト メソッド LoadViewState  データ ソース ビューの、以前保存したビューステート復元します。 (DataControlField から継承されます。)
プロテクト メソッド MemberwiseClone  現在の Object簡易コピー作成します。 (Object から継承されます。)
プロテクト メソッド OnFieldChanged  FieldChanged イベント発生させます。 (DataControlField から継承されます。)
プロテクト メソッド SaveViewState  ページサーバーポストバックされた時間以降発生したDataControlField ビューステートへの変更保存します。 (DataControlField から継承されます。)
プロテクト メソッド TrackViewState  DataControlField オブジェクトがそのビューステート変更追跡するようにします。それにより、変更コントロールViewState プロパティ格納して、同じページ対す複数要求わたって永続化できます。 (DataControlField から継承されます。)
参照参照

関連項目

TemplateField クラス
System.Web.UI.WebControls 名前空間
GridView クラス
GridView.Columns プロパティ
DetailsView クラス
DetailsView.Fields プロパティ
BoundField クラス
ButtonField クラス
CheckBoxField クラス
CommandField クラス
DataControlField クラス
HyperLinkField クラス
AlternatingItemTemplate
EditItemTemplate
FooterTemplate
HeaderTemplate
InsertItemTemplate
ItemTemplate
DataControlField.Visible プロパティ



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「TemplateField」の関連用語

TemplateFieldのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TemplateFieldのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS