DataControlFieldCell イベント
パブリック イベント| 名前 | 説明 | |
|---|---|---|
| DataBinding | サーバー コントロールがデータ ソースに連結すると発生します。 ( Control から継承されます。) |
| Disposed | サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。 ( Control から継承されます。) |
| Init | サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。 ( Control から継承されます。) |
| Load | サーバー コントロールが Page オブジェクトに読み込まれると発生します。 ( Control から継承されます。) |
| PreRender | Control オブジェクトの読み込み後、表示を開始する前に発生します。 ( Control から継承されます。) |
| Unload | サーバー コントロールがメモリからアンロードされると発生します。 ( Control から継承されます。) |
参照DataControlFieldCell クラス
アセンブリ: System.Web (system.web.dll 内)
構文
解説DataControlFieldCell クラスは、GridView や DetailsView のように内容を表形式のレイアウトで表示する ASP.NET データ バインド コントロール内のセルを表す、厳密に型指定された TableCell クラスです。
DataControlFieldCell オブジェクトを格納する DataControlField オブジェクトは、セルにスタイルを適用して、セルの表示方法を制御します。DataControlField オブジェクトにアクセスするには、ContainingField プロパティを使用します。
使用例DataControlField から派生するクラスで、DataControlFieldCell オブジェクトを使用および操作するコード例を次に示します。RadioButtonField クラスは、RadioButton コントロールを InitializeCell メソッド内の各 DataControlFieldCell オブジェクトに追加し、後で ExtractValuesFromCell メソッド内の RadioButton コントロールの値を確認します。このコード例は、DataControlField クラスのトピックで取り上げているコード例の一部分です。
' This method is called by the ExtractRowValues methods of ' GridView and DetailsView. Retrieve the current value of the ' cell from the Checked state of the Radio button. Public Overrides Sub ExtractValuesFromCell( _ ByVal dictionary As IOrderedDictionary, _ ByVal cell As DataControlFieldCell, _ ByVal rowState As DataControlRowState, _ ByVal includeReadOnly As Boolean) ' Determine whether the cell contain a RadioButton ' in its Controls collection. If cell.Controls.Count > 0 Then Dim radio As RadioButton = CType(cell.Controls(0), RadioButton) Dim checkedValue As Object = Nothing If radio Is Nothing Then ' A RadioButton is expected, but a null is encountered. ' Add error handling. Throw New InvalidOperationException( _ "RadioButtonField could not extract control.") Else checkedValue = radio.Checked End If ' Add the value of the Checked attribute of the ' RadioButton to the dictionary. If dictionary.Contains(DataField) Then dictionary(DataField) = checkedValue Else dictionary.Add(DataField, checkedValue) End If End If End Sub
// This method is called by the ExtractRowValues methods of // GridView and DetailsView. Retrieve the current value of the // cell from the Checked state of the Radio button. public override void ExtractValuesFromCell(IOrderedDictionary dictionary, DataControlFieldCell cell, DataControlRowState rowState, bool includeReadOnly) { // Determine whether the cell contains a RadioButton // in its Controls collection. if (cell.Controls.Count > 0) { RadioButton radio = cell.Controls[0] as RadioButton; object checkedValue = null; if (null == radio) { // A RadioButton is expected, but a null is encountered. // Add error handling. throw new InvalidOperationException ("RadioButtonField could not extract control."); } else { checkedValue = radio.Checked; } // Add the value of the Checked attribute of the // RadioButton to the dictionary. if (dictionary.Contains(DataField)) dictionary[DataField] = checkedValue; else dictionary.Add(DataField, checkedValue); } }
// This method is called by the ExtractRowValues methods on GridView //and DetailsView. Retrieve // the current value of the cell from the Checked state of the Radio button. public void ExtractValuesFromCell(IOrderedDictionary dictionary, DataControlFieldCell cell, DataControlRowState rowState, boolean includeReadOnly) throws InvalidOperationException { // Does the cell contain a RadioButton in its Controls collection? if (cell.get_Controls().get_Count() > 0) { RadioButton radio = (RadioButton)cell.get_Controls().get_Item(0); Object checkedValue = null; if (null == radio) { // A RadioButton is expected, // but a null is encountered. Add error handling. throw new InvalidOperationException("RadioButtonField could not" + "extract control."); } else { checkedValue = (System.Boolean)radio.get_Checked(); } // Add the value of the Checked attribute of the // RadioButton to the dictionary. if (dictionary.Contains(get_DataField())) { dictionary.set_Item(get_DataField(), checkedValue); } else { dictionary.Add(get_DataField(), checkedValue); } } } //ExtractValuesFromCell
.NET Framework のセキュリティ
継承階層System.Web.UI.Control
System.Web.UI.WebControls.WebControl
System.Web.UI.WebControls.TableCell
System.Web.UI.WebControls.DataControlFieldCell
System.Web.UI.WebControls.DataControlFieldHeaderCell
スレッド セーフ
プラットフォーム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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照DataControlFieldCell コンストラクタ (DataControlField)
アセンブリ: System.Web (system.web.dll 内)
構文
解説DataControlFieldCell コンストラクタはセルを表示するために、基本クラスで定義された HtmlTextWriterTag.Td 要素を使用します。containingField パラメータに渡された DataControlField オブジェクトは、ヘッダーを表示するかどうか、およびセルを表示するときにどのスタイルを適用するかを判断するために使用されます。
プラットフォーム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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照DataControlFieldCell コンストラクタ (HtmlTextWriterTag, DataControlField)
アセンブリ: System.Web (system.web.dll 内)
構文Dim tagKey As HtmlTextWriterTag Dim containingField As DataControlField Dim instance As New DataControlFieldCell(tagKey, containingField)
protected function DataControlFieldCell ( tagKey : HtmlTextWriterTag, containingField : DataControlField )
解説tagKey パラメータは、WebControl 基本クラス コンストラクタに渡され、コントロールから出力される HTML タグを制御します。containingField パラメータに渡された DataControlField は、ヘッダーを表示するかどうか、およびセルを表示するときにどのスタイルを適用するかを判断するために使用されます。
プラットフォーム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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照DataControlFieldCell コンストラクタ
オーバーロードの一覧| 名前 | 説明 |
|---|---|
| DataControlFieldCell (DataControlField) | 指定した DataControlField オブジェクトをセルのコンテナとして設定して、DataControlFieldCell クラスの新しいインスタンスを初期化します。 |
| DataControlFieldCell (HtmlTextWriterTag, DataControlField) | 指定した DataControlField オブジェクトをセルのコンテナとして設定して、DataControlFieldCell クラスの新しいインスタンスを初期化します。 |
参照DataControlFieldCell プロパティ
パブリック プロパティ
プロテクト プロパティ
参照DataControlFieldCell メソッド
パブリック メソッド
プロテクト メソッド
参照DataControlFieldCell メンバ
DetailsView、GridView などの表形式の ASP.NET データ バインド コントロールの、表示された表内のセルを表します。
DataControlFieldCell データ型で公開されるメンバを以下の表に示します。
パブリック コンストラクタ| 名前 | 説明 | |
|---|---|---|
| DataControlFieldCell | オーバーロードされます。 DataControlFieldCell クラスの新しいインスタンスを初期化します。 |
プロテクト コンストラクタ
パブリック プロパティ
プロテクト プロパティ
パブリック メソッド
プロテクト メソッド
パブリック イベント| 名前 | 説明 | |
|---|---|---|
| DataBinding | サーバー コントロールがデータ ソースに連結すると発生します。(Control から継承されます。) |
| Disposed | サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。(Control から継承されます。) |
| Init | サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。(Control から継承されます。) |
| Load | サーバー コントロールが Page オブジェクトに読み込まれると発生します。(Control から継承されます。) |
| PreRender | Control オブジェクトの読み込み後、表示を開始する前に発生します。(Control から継承されます。) |
| Unload | サーバー コントロールがメモリからアンロードされると発生します。(Control から継承されます。) |
参照- DataControlFieldCellのページへのリンク