TemplateField クラス
アセンブリ: System.Web (system.web.dll 内)


データ バインド コントロール (GridView、DetailsView など) はこの TemplateField クラスを使用して、表示される各レコードのカスタムの内容を表示します。いずれかの定義済みのデータ コントロール フィールド (BoundField など) で提供されないデータ バインド コントロールに内容を表示する場合は、TemplateField クラスを使用して、カスタム ユーザー インターフェイス (UI: User Interface) を作成します。TemplateField オブジェクトは、それが使用されているデータ バインド コントロールによって表示が異なります。たとえば、TemplateField オブジェクトは、GridView コントロールでは列として表示され、DetailsView コントロールでは行として表示されます。
次の表に示すテンプレートを使用して、TemplateField オブジェクトのさまざまな部分についてカスタム テンプレートを定義できます。
AlternatingItemTemplate | |
EditItemTemplate | |
FooterTemplate | |
HeaderTemplate | |
InsertItemTemplate | TemplateField オブジェクトの挿入モードの項目に表示する内容を指定します。このテンプレートは、DetailsView コントロールだけでサポートされます。 |
ItemTemplate |
データ バインド コントロール内の TemplateField オブジェクトを非表示にするには、Visible プロパティを false に設定します。
カスタムの HeaderTemplate テンプレートまたは FooterTemplate テンプレートを定義する代わりに、TemplateField オブジェクトの他のプロパティを設定して、TemplateField オブジェクトのヘッダー セクションとフッター セクションをカスタマイズできます。ヘッダー セクションにキャプションを表示するには、HeaderText プロパティを設定します。フッター セクションにキャプションを表示するには、FooterText プロパティを設定します。ヘッダー セクションにテキストを表示する代わりに、HeaderImageUrl プロパティを設定してイメージを表示できます。ShowHeader プロパティを false に設定することにより、TemplateField オブジェクトでヘッダー セクションを非表示にできます。
![]() |
---|
一部のデータ バインド コントロール (GridView コントロールなど) では、コントロールのヘッダー セクション全体を表示または非表示にできます。これらのデータ バインド コントロールは、個別にバインドされたフィールドの ShowHeader プロパティをサポートしません。データ バインド コントロールのヘッダー セクション (存在する場合) 全体を表示または非表示にするには、コントロールの ShowHeader プロパティを使用します。 |
また、フィールドの各部分にスタイル プロパティを設定すると、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>


System.Web.UI.WebControls.DataControlField
System.Web.UI.WebControls.TemplateField


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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 コンストラクタ
アセンブリ: System.Web (system.web.dll 内)


このコンストラクタを使用して、TemplateField クラスの新しいインスタンスを初期化します。通常、このコンストラクタは、動的に作成されたデータ バインド コントロールにフィールドを追加する場合に使用されます。
TemplateField オブジェクトをデータ バインド コントロールに動的に追加するには、新しい TemplateField オブジェクトを作成して適切なテンプレートを定義し、データ バインド コントロールのフィールド コレクションに追加します。たとえば、GridView コントロールを使用する場合は、TemplateField オブジェクトを Columns コレクションに追加します。
![]() |
---|
フィールドはデータ バインド コントロールに動的に追加することもできますが、フィールドを静的に宣言しておき、適宜、表示または非表示にすることをお勧めします。フィールドをすべて静的に宣言すると、親データ バインド コントロールのビューステートのサイズを削減できます。 |

コンストラクタを使用して、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>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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 データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | 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 プロパティ
- TemplateFieldのページへのリンク