HierarchicalDataBoundControl クラス

定義

データを階層形式で表示する ASP.NET Version 2.0 のデータ バインド コントロールすべての基底クラスとして機能します。

public ref class HierarchicalDataBoundControl abstract : System::Web::UI::WebControls::BaseDataBoundControl
public abstract class HierarchicalDataBoundControl : System.Web.UI.WebControls.BaseDataBoundControl
type HierarchicalDataBoundControl = class
    inherit BaseDataBoundControl
Public MustInherit Class HierarchicalDataBoundControl
Inherits BaseDataBoundControl
継承
HierarchicalDataBoundControl
派生

次のコード例では、 クラスから HierarchicalDataBoundControl クラスを派生して、カスタム データ バインド コントロールを作成する方法を示します。 コントロールは GeneologyTreepre 関連付けられたデータ ソース コントロールから取得されたデータのテキスト ツリーを含む HTML セクションをレンダリングします。

using System;
using System.Collections;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Samples.AspNet.CS.Controls {

    [AspNetHostingPermission(SecurityAction.Demand, 
        Level=AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, 
        Level=AspNetHostingPermissionLevel.Minimal)]
    public class GeneologyTree : HierarchicalDataBoundControl {

        private TreeNode rootNode;
        public TreeNode RootNode {
            get {
                rootNode ??= new TreeNode(String.Empty);
                return rootNode;
            }
        }
        
        private ArrayList nodes;
        public ArrayList Nodes {
            get {
                if (null == nodes) {
                    nodes = new ArrayList();
                }
                return nodes;
            }
        }
        public string DataTextField {
            get {
                object o = ViewState["DataTextField"];
                return((o == null) ? string.Empty : (string)o);
            }
            set {
                ViewState["DataTextField"] = value;
                if (Initialized) {
                    OnDataPropertyChanged();
                }
            }
        }
        private int _maxDepth = 0;
        protected override void PerformDataBinding() {
            base.PerformDataBinding();

            // Do not attempt to bind data if there is no
            // data source set.
            if (!IsBoundUsingDataSourceID && (DataSource == null)) {
                return;
            }
            
            HierarchicalDataSourceView view = GetData(RootNode.DataPath);
            
            if (view == null) {
                throw new InvalidOperationException
                    ("No view returned by data source control.");
            }                                  
            
            IHierarchicalEnumerable enumerable = view.Select();
            if (enumerable != null) {
                            
                Nodes.Clear();
                                
                try {
                    RecurseDataBindInternal(RootNode, enumerable, 1);
                }
                finally {
                }
            }
        }
        private void RecurseDataBindInternal(TreeNode node, 
            IHierarchicalEnumerable enumerable, int depth) {                                    
                        
            foreach(object item in enumerable) {
                IHierarchyData data = enumerable.GetHierarchyData(item);

                if (null != data) {
                    // Create an object that represents the bound data
                    // to the control.
                    TreeNode newNode = new TreeNode();
                    RootViewNode rvnode = new RootViewNode();
                    
                    rvnode.Node = newNode;
                    rvnode.Depth = depth;

                    // The dataItem is not just a string, but potentially
                    // an XML node or some other container. 
                    // If DataTextField is set, use it to determine which 
                    // field to render. Otherwise, use the first field.                    
                    if (DataTextField.Length > 0) {
                        newNode.Text = DataBinder.GetPropertyValue
                            (data, DataTextField, null);
                    }
                    else {
                        PropertyDescriptorCollection props = 
                            TypeDescriptor.GetProperties(data);

                        // Set the "default" value of the node.
                        newNode.Text = String.Empty;                        

                        // Set the true data-bound value of the TextBox,
                        // if possible.
                        if (props.Count >= 1) {                        
                            if (null != props[0].GetValue(data)) {
                                newNode.Text = 
                                    props[0].GetValue(data).ToString();
                            } 
                        }
                    }

                    Nodes.Add(rvnode);                    
                    
                    if (data.HasChildren) {
                        IHierarchicalEnumerable newEnumerable = 
                            data.GetChildren();
                        if (newEnumerable != null) {                            
                            RecurseDataBindInternal(newNode, 
                                newEnumerable, depth+1 );
                        }
                    }
                    
                    if ( _maxDepth < depth) _maxDepth = depth;
                }
            }
        }
        protected override void Render(HtmlTextWriter writer) {
                        
            writer.WriteLine("<PRE>");                        
            int currentDepth = 1;
            int currentTextLen = 0;
            
            foreach (RootViewNode rvnode in Nodes) {
                if (rvnode.Depth == currentDepth) {
                    string output = "  " + rvnode.Node.Text + "  ";
                    writer.Write(output);
                    currentTextLen = currentTextLen + output.Length;
                }
                else {
                    writer.WriteLine("");
                    // Some very basic white-space formatting
                    int halfLine = currentTextLen / 2;
                    for (int i=0;i<halfLine;i++) {
                        writer.Write(' ');
                    }
                    writer.Write('|');
                    writer.WriteLine("");
                    ++currentDepth; 
                    currentTextLen = 0;
                    for (int j=0;j<halfLine;j++) {
                        writer.Write(' ');
                    }
                    string output = "  " + rvnode.Node.Text + "  ";
                    writer.Write(output);
                    currentTextLen = currentTextLen + output.Length;                    
                }                                                           
            }
            writer.WriteLine("</PRE>");
        }
        
        private class RootViewNode { 
            public TreeNode Node;
            public int Depth;
        }
    }
}
Imports System.Collections
Imports System.ComponentModel
Imports System.Security.Permissions
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace Samples.AspNet.VB.Controls

    <AspNetHostingPermission(SecurityAction.Demand, _
      Level:=AspNetHostingPermissionLevel.Minimal), _
      AspNetHostingPermission(SecurityAction.InheritanceDemand, _
      Level:=AspNetHostingPermissionLevel.Minimal)> _
    Public Class GeneologyTree
        Inherits HierarchicalDataBoundControl

        Dim MaxDepth As Integer = 0

        Private aRootNode As TreeNode
        Public ReadOnly Property RootNode() As TreeNode
            Get
                If aRootNode Is Nothing Then
                    aRootNode = New TreeNode(String.Empty)
                End If
                Return aRootNode
            End Get
        End Property

        Private alNodes As ArrayList
        Public ReadOnly Property Nodes() As ArrayList
            Get
                If alNodes Is Nothing Then
                    alNodes = New ArrayList()
                End If
                Return alNodes
            End Get
        End Property

        Public Property DataTextField() As String
            Get
                Dim o As Object = ViewState("DataTextField")
                If o Is Nothing Then
                    Return String.Empty
                Else
                    Return CStr(o)
                End If
            End Get
            Set(ByVal value As String)
                ViewState("DataTextField") = value
                If Initialized Then
                    OnDataPropertyChanged()
                End If
            End Set
        End Property

        Protected Overrides Sub PerformDataBinding()
            MyBase.PerformDataBinding()

            ' Do not attempt to bind data if there is no
            ' data source set.
            If Not IsBoundUsingDataSourceID AndAlso DataSource Is Nothing Then
                Return
            End If

            Dim view As HierarchicalDataSourceView = GetData(RootNode.DataPath)

            If view Is Nothing Then
                Throw New InvalidOperationException _
                ("No view returned by data source control.")
            End If

            Dim enumerable As IHierarchicalEnumerable = view.Select()
            If Not (enumerable Is Nothing) Then

                Nodes.Clear()

                Try
                    RecurseDataBindInternal(RootNode, enumerable, 1)
                Finally
                End Try
            End If

        End Sub

        Private Sub RecurseDataBindInternal(ByVal node As TreeNode, _
            ByVal enumerable As IHierarchicalEnumerable, _
            ByVal depth As Integer)

            Dim item As Object
            For Each item In enumerable

                Dim data As IHierarchyData = enumerable.GetHierarchyData(item)

                If Not data Is Nothing Then

                    ' Create an object that represents the bound data
                    ' to the control.
                    Dim newNode As New TreeNode()
                    Dim rvnode As New RootViewNode()

                    rvnode.Node = newNode
                    rvnode.Depth = depth

                    ' The dataItem is not just a string, but potentially
                    ' an XML node or some other container. 
                    ' If DataTextField is set, use it to determine which 
                    ' field to render. Otherwise, use the first field.                    
                    If DataTextField.Length > 0 Then
                        newNode.Text = DataBinder.GetPropertyValue _
                        (data, DataTextField, Nothing)
                    Else
                        Dim props As PropertyDescriptorCollection = _
                        TypeDescriptor.GetProperties(data)

                        ' Set the "default" value of the node.
                        newNode.Text = String.Empty

                        ' Set the true data-bound value of the TextBox,
                        ' if possible.
                        If props.Count >= 1 Then
                            If Not props(0).GetValue(data) Is Nothing Then
                                newNode.Text = props(0).GetValue(data).ToString()
                            End If
                        End If
                    End If

                    Nodes.Add(rvnode)

                    If data.HasChildren Then
                        Dim newEnumerable As IHierarchicalEnumerable = _
                            data.GetChildren()
                        If Not (newEnumerable Is Nothing) Then
                            RecurseDataBindInternal(newNode, _
                            newEnumerable, depth + 1)
                        End If
                    End If

                    If MaxDepth < depth Then
                        MaxDepth = depth
                    End If
                End If
            Next item

        End Sub

        Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)

            writer.WriteLine("<PRE>")
            Dim currentDepth As Integer = 1
            Dim currentTextLen As Integer = 0

            Dim rvnode As RootViewNode
            For Each rvnode In Nodes
                If rvnode.Depth = currentDepth Then
                    Dim output As String = "  " + rvnode.Node.Text + "  "
                    writer.Write(output)
                    currentTextLen = currentTextLen + output.Length
                Else
                    writer.WriteLine("")

                    ' Some very basic white-space formatting.
                    ' The implicit conversion to an Integer is fine, as 
                    ' a general estimate is acceptable for this 
                    ' simple example.
                    Dim halfLine As Integer = CInt(currentTextLen / 2)
                    Dim i As Integer
                    For i = 0 To halfLine
                        writer.Write(" "c)
                    Next i
                    writer.Write("|"c)
                    writer.WriteLine("")
                    currentDepth += 1
                    Dim j As Integer
                    For j = 0 To halfLine
                        writer.Write(" "c)
                    Next j
                    Dim output As String = "  " + rvnode.Node.Text + "  "
                    writer.Write(output)
                    currentTextLen = currentTextLen + output.Length
                End If
            Next rvnode
            writer.WriteLine("</PRE>")

        End Sub


        Private Class RootViewNode
            Public Node As TreeNode
            Public Depth As Integer
        End Class
    End Class
End Namespace

次のコード例では、前の例で定義した コントロールを GeneologyTree 使用し、コントロールにバインドする方法を XmlDataSource 示します。

<%@Page language="c#" %>
<%@ Register TagPrefix="aspSample" 
    Namespace="Samples.AspNet.CS.Controls" 
    Assembly="Samples.AspNet.CS.Controls" %>

<!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>
    <title>C# Example</title>
  </head>

  <body>
    <form id="Form1" method="post" runat="server">

        <aspSample:geneologytree
          id="GeneologyTree1"
          runat="server"
          datatextfield="title"
          datasourceid="XmlDataSource1" />

        <asp:xmldatasource
          id="XmlDataSource1"
          datafile="geneology.xml"          
          runat="server" />
          
    </form>
  </body>
</html>
<%@Page language="VB" %>
<%@ Register TagPrefix="aspSample" 
    Namespace="Samples.AspNet.VB.Controls" 
    Assembly="Samples.AspNet.VB.Controls" %>

<!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>
    <title>VB Example</title>
  </head>

  <body>
    <form id="Form1" method="post" runat="server">

        <aspSample:geneologytree
          id="GeneologyTree1"
          runat="server"
          datatextfield="title"
          datasourceid="XmlDataSource1" />

        <asp:xmldatasource
          id="XmlDataSource1"
          datafile="geneology.xml"          
          runat="server" />
          
    </form>
  </body>
</html>

コード例でアクセスするgeneology.xml ファイルには、次のデータが含まれています。

<family>  
  <member title="great-grandfather">  
    <member title="grandfather" >  
      <member title="child" />  
      <member title="father" >  
         <member title="son" />  
      </member>  
    </member>  
  </member>  
</family>  

注釈

クラスは HierarchicalDataBoundControl 、ASP.NET 階層データ ソース コントロールからデータを取得し、コントロールのユーザー インターフェイス要素をそのデータにバインドして表示する ASP.NET コントロールに使用される基本クラスです。 クラスと Menu クラスは TreeView からHierarchicalDataBoundControl派生します。

ページ開発者は、 クラスを HierarchicalDataBoundControl 直接使用しません。代わりに、このクラスから派生したコントロールを使用します。

コントロール開発者は、このクラスを拡張して、 クラスと HierarchicalDataSourceView クラスから派生するインターフェイスとクラスをIHierarchicalDataSource実装するクラスを操作するデータ バインド コントロールをHierarchicalDataSourceControl作成します。 クラスから HierarchicalDataBoundControl クラスを派生させる場合は、 メソッドを PerformDataBinding オーバーライドして、コントロールのユーザー インターフェイス要素を メソッドによって GetData 取得されたデータにバインドします。 ほとんどの場合、 PerformDataBinding メソッドは、派生クラスでオーバーライドする唯一のメソッドです。

ASP.NET 2.0 データ バインド コントロールの場合、 PerformSelect メソッドは メソッドと同等 DataBind であり、実行時にデータをバインドするために 呼び出されます。 メソッドは PerformSelect メソッドと PerformDataBinding メソッドをGetData呼び出します。

コンストラクター

HierarchicalDataBoundControl()

HierarchicalDataBoundControl クラスの新しいインスタンスを初期化します。

プロパティ

AccessKey

Web サーバー コントロールにすばやく移動できるアクセス キーを取得または設定します。

(継承元 WebControl)
Adapter

コントロール用のブラウザー固有のアダプターを取得します。

(継承元 Control)
AppRelativeTemplateSourceDirectory

このコントロールが含まれている Page オブジェクトまたは UserControl オブジェクトのアプリケーション相対の仮想ディレクトリを取得または設定します。

(継承元 Control)
Attributes

コントロールのプロパティに対応しない任意の属性 (表示専用) のコレクションを取得します。

(継承元 WebControl)
BackColor

Web サーバー コントロールの背景色を取得または設定します。

(継承元 WebControl)
BindingContainer

このコントロールのデータ バインディングを格納しているコントロールを取得します。

(継承元 Control)
BorderColor

Web コントロールの境界線の色を取得または設定します。

(継承元 WebControl)
BorderStyle

Web サーバー コントロールの境界線スタイルを取得または設定します。

(継承元 WebControl)
BorderWidth

Web サーバー コントロールの境界線の幅を取得または設定します。

(継承元 WebControl)
ChildControlsCreated

サーバー コントロールの子コントロールが作成されたかどうかを示す値を取得します。

(継承元 Control)
ClientID

ASP.NET によって生成される HTML マークアップのコントロール ID を取得します。

(継承元 Control)
ClientIDMode

ClientID プロパティの値を生成するために使用されるアルゴリズムを取得または設定します。

(継承元 Control)
ClientIDSeparator

ClientID プロパティで使用される区切り記号を表す文字値を取得します。

(継承元 Control)
Context

現在の Web 要求に対するサーバー コントロールに関連付けられている HttpContext オブジェクトを取得します。

(継承元 Control)
Controls

UI 階層内の指定されたサーバー コントロールの子コントロールを表す ControlCollection オブジェクトを取得します。

(継承元 Control)
ControlStyle

Web サーバー コントロールのスタイルを取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
ControlStyleCreated

Style オブジェクトが ControlStyle プロパティに対して作成されたかどうかを示す値を取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
CssClass

クライアントで Web サーバー コントロールによって表示されるカスケード スタイル シート (CSS: Cascading Style Sheet) クラスを取得または設定します。

(継承元 WebControl)
DataItemContainer

名前付けコンテナーが IDataItemContainer を実装している場合、名前付けコンテナーへの参照を取得します。

(継承元 Control)
DataKeysContainer

名前付けコンテナーが IDataKeysControl を実装している場合、名前付けコンテナーへの参照を取得します。

(継承元 Control)
DataSource

データ バインド コントロールがデータ項目一覧を取得する際の取得元となるオブジェクトを取得または設定します。

(継承元 BaseDataBoundControl)
DataSourceID

データ バインド コントロールによるデータ項目の一覧の取得元となるコントロールの ID を取得または設定します。

DesignMode

コントロールがデザイン サーフェイスで使用されているかどうかを示す値を取得します。

(継承元 Control)
Enabled

Web サーバー コントロールを有効にするかどうかを示す値を取得または設定します。

(継承元 WebControl)
EnableTheming

テーマがこのコントロールに適用されるかどうかを示す値を取得または設定します。

(継承元 WebControl)
EnableViewState

要求元クライアントに対して、サーバー コントロールがそのビュー状態と、そこに含まれる任意の子のコントロールのビュー状態を保持するかどうかを示す値を取得または設定します。

(継承元 Control)
Events

コントロールのイベント ハンドラー デリゲートのリストを取得します。 このプロパティは読み取り専用です。

(継承元 Control)
Font

Web サーバー コントロールに関連付けられたフォント プロパティを取得します。

(継承元 WebControl)
ForeColor

Web サーバー コントロールの前景色 (通常はテキストの色) を取得または設定します。

(継承元 WebControl)
HasAttributes

コントロールに属性セットがあるかどうかを示す値を取得します。

(継承元 WebControl)
HasChildViewState

現在のサーバー コントロールの子コントロールが、保存されたビューステートの設定を持っているかどうかを示す値を取得します。

(継承元 Control)
Height

Web サーバー コントロールの高さを取得または設定します。

(継承元 WebControl)
ID

サーバー コントロールに割り当てられたプログラム ID を取得または設定します。

(継承元 Control)
IdSeparator

コントロール ID を区別するために使用する文字を取得します。

(継承元 Control)
Initialized

データ バインド コントロールが初期化されているかどうかを示す値を取得します。

(継承元 BaseDataBoundControl)
IsBoundUsingDataSourceID

DataSourceID プロパティが設定されているかどうかを示す値を取得します。

(継承元 BaseDataBoundControl)
IsChildControlStateCleared

このコントロールに含まれているコントロールに、コントロールの状態が設定されているかどうかを示す値を取得します。

(継承元 Control)
IsDataBindingAutomatic

データ バインドが自動かどうか示す値を取得します。

(継承元 BaseDataBoundControl)
IsEnabled

コントロールが有効かどうかを示す値を取得します。

(継承元 WebControl)
IsTrackingViewState

サーバー コントロールがビューステートの変更を保存しているかどうかを示す値を取得します。

(継承元 Control)
IsUsingModelBinders

派生クラスで実装された場合、コントロールでモデル バインダーを使用しているかどうかを示す値を取得します。

(継承元 BaseDataBoundControl)
IsViewStateEnabled

このコントロールでビューステートが有効かどうかを示す値を取得します。

(継承元 Control)
LoadViewStateByID

コントロールがインデックスではなく ID によりビューステートの読み込みを行うかどうかを示す値を取得します。

(継承元 Control)
NamingContainer

同じ ID プロパティ値を持つ複数のサーバー コントロールを区別するための一意の名前空間を作成する、サーバー コントロールの名前付けコンテナーへの参照を取得します。

(継承元 Control)
Page

サーバー コントロールを含んでいる Page インスタンスへの参照を取得します。

(継承元 Control)
Parent

ページ コントロールの階層構造における、サーバー コントロールの親コントロールへの参照を取得します。

(継承元 Control)
RenderingCompatibility

レンダリングされる HTML と互換性がある ASP.NET のバージョンを表す値を取得します。

(継承元 Control)
RequiresDataBinding

DataBind() メソッドを呼び出す必要があるかどうか示す値を取得または設定します。

(継承元 BaseDataBoundControl)
Site

デザイン サーフェイスに現在のコントロールを表示するときに、このコントロールをホストするコンテナーに関する情報を取得します。

(継承元 Control)
SkinID

コントロールに適用するスキンを取得または設定します。

(継承元 WebControl)
Style

Web サーバー コントロールの外側のタグにスタイル属性として表示されるテキスト属性のコレクションを取得します。

(継承元 WebControl)
SupportsDisabledAttribute

コントロールの disabled プロパティが IsEnabled の場合、レンダリングされた HTML 要素の false 属性を "無効" に設定するかどうかを示す値を取得します。

(継承元 BaseDataBoundControl)
TabIndex

Web サーバー コントロールのタブ インデックスを取得または設定します。

(継承元 WebControl)
TagKey

この Web サーバー コントロールに対応する HtmlTextWriterTag 値を取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
TagName

コントロール タグの名前を取得します。 このプロパティは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
TemplateControl

このコントロールを格納しているテンプレートへの参照を取得または設定します。

(継承元 Control)
TemplateSourceDirectory

現在のサーバー コントロールを格納している Page または UserControl の仮想ディレクトリを取得します。

(継承元 Control)
ToolTip

マウス ポインターが Web サーバー コントロールの上を移動したときに表示されるテキストを取得または設定します。

(継承元 WebControl)
UniqueID

階層構造で修飾されたサーバー コントロールの一意の ID を取得します。

(継承元 Control)
ValidateRequestMode

ブラウザーからのクライアント入力の安全性をコントロールで調べるかどうかを示す値を取得または設定します。

(継承元 Control)
ViewState

同一のページに対する複数の要求にわたって、サーバー コントロールのビューステートを保存し、復元できるようにする状態情報のディクショナリを取得します。

(継承元 Control)
ViewStateIgnoresCase

StateBag オブジェクトが大文字小文字を区別しないかどうかを示す値を取得します。

(継承元 Control)
ViewStateMode

このコントロールのビューステート モードを取得または設定します。

(継承元 Control)
Visible

サーバー コントロールがページ上の UI としてレンダリングされているかどうかを示す値を取得または設定します。

(継承元 Control)
Width

Web サーバー コントロールの幅を取得または設定します。

(継承元 WebControl)

メソッド

AddAttributesToRender(HtmlTextWriter)

指定した HtmlTextWriterTag に表示する必要のある HTML 属性およびスタイルを追加します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
AddedControl(Control, Int32)

子コントロールが Control オブジェクトの Controls コレクションに追加された後に呼び出されます。

(継承元 Control)
AddParsedSubObject(Object)

XML または HTML のいずれかの要素が解析されたことをサーバー コントロールに通知し、サーバー コントロールの ControlCollection オブジェクトに要素を追加します。

(継承元 Control)
ApplyStyle(Style)

指定したスタイルの空白以外の要素を Web コントロールにコピーして、コントロールの既存のスタイル要素を上書きします。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
ApplyStyleSheetSkin(Page)

ページのスタイル シートに定義されたスタイル プロパティをコントロールに適用します。

(継承元 Control)
BeginRenderTracing(TextWriter, Object)

レンダリング データのデザイン時のトレースを開始します。

(継承元 Control)
BuildProfileTree(String, Boolean)

ページのトレースが有効な場合、サーバー コントロールに関する情報を収集し、これを表示するために Trace プロパティに渡します。

(継承元 Control)
ClearCachedClientID()

キャッシュされた ClientID 値を null に設定します。

(継承元 Control)
ClearChildControlState()

サーバー コントロールのすべての子コントロールについて、コントロールの状態情報を削除します。

(継承元 Control)
ClearChildState()

サーバー コントロールのすべての子コントロールのビューステート情報およびコントロールの状態情報を削除します。

(継承元 Control)
ClearChildViewState()

サーバー コントロールのすべての子コントロールのビューステート情報を削除します。

(継承元 Control)
ClearEffectiveClientIDMode()

現在のコントロール インスタンスおよびすべての子コントロールの ClientIDMode プロパティを Inherit に設定します。

(継承元 Control)
ConfirmInitState()

データ バインド コントロールの初期化状態を設定します。

(継承元 BaseDataBoundControl)
CopyBaseAttributes(WebControl)

指定した Web サーバー コントロールから、Style オブジェクトでカプセル化されていないプロパティをこのメソッドの呼び出し元の Web サーバー コントロールにコピーします。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
CreateChildControls()

ASP.NET ページ フレームワークによって呼び出され、ポストバックまたはレンダリングの準備として、合成ベースの実装を使うサーバー コントロールに対し、それらのコントロールに含まれる子コントロールを作成するように通知します。

(継承元 Control)
CreateControlCollection()

サーバー コントロールの子コントロール (リテラルとサーバーの両方) を保持する新しい ControlCollection オブジェクトを作成します。

(継承元 Control)
CreateControlStyle()

WebControl クラスで、すべてのスタイル関連プロパティを実装するために内部的に使用されるスタイル オブジェクトを作成します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
DataBind()

呼び出されたサーバー コントロールとそのすべての子コントロールにデータ ソースをバインドします。

(継承元 BaseDataBoundControl)
DataBind(Boolean)

DataBinding イベントを発生させるオプションを指定して、呼び出されたサーバー コントロールとそのすべての子コントロールにデータ ソースをバインドします。

(継承元 Control)
DataBindChildren()

データ ソースをサーバー コントロールの子コントロールにバインドします。

(継承元 Control)
Dispose()

サーバー コントロールが、メモリから解放される前に最終的なクリーンアップを実行できるようにします。

(継承元 Control)
EndRenderTracing(TextWriter, Object)

レンダリング データのデザイン時のトレースを終了します。

(継承元 Control)
EnsureChildControls()

サーバー コントロールに子コントロールが含まれているかどうかを確認します。 含まれていない場合、子コントロールを作成します。

(継承元 Control)
EnsureDataBound()

DataBind() プロパティが設定されていて、データ バインド コントロールにバインディングが必要とマークされている場合に、DataSourceID メソッドを呼び出します。

(継承元 BaseDataBoundControl)
EnsureID()

ID が割り当てられていないコントロールの ID を作成します。

(継承元 Control)
Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
FindControl(String)

指定した id パラメーターを使用して、サーバー コントロールの現在の名前付けコンテナーを検索します。

(継承元 Control)
FindControl(String, Int32)

指定した id および検索に役立つ pathOffset パラメーターに指定された整数を使用して、サーバー コントロールの現在の名前付けコンテナーを検索します。 この形式の FindControl メソッドはオーバーライドしないでください。

(継承元 Control)
Focus()

コントロールに入力フォーカスを設定します。

(継承元 Control)
GetData(String)

データ操作を実行するために、データ バインド コントロールが使用する HierarchicalDataSourceView オブジェクトを取得します。

GetDataSource()

データ バインド コントロールが関連付けられている IHierarchicalDataSource を取得します (存在する場合)。

GetDesignModeState()

コントロールのデザイン時データを取得します。

(継承元 Control)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetRouteUrl(Object)

ルート パラメーターのセットに対応する URL を取得します。

(継承元 Control)
GetRouteUrl(RouteValueDictionary)

ルート パラメーターのセットに対応する URL を取得します。

(継承元 Control)
GetRouteUrl(String, Object)

ルート パラメーターのセットおよびルート名に対応する URL を取得します。

(継承元 Control)
GetRouteUrl(String, RouteValueDictionary)

ルート パラメーターのセットおよびルート名に対応する URL を取得します。

(継承元 Control)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
GetUniqueIDRelativeTo(Control)

指定されたコントロールの UniqueID プロパティのプレフィックス部分を返します。

(継承元 Control)
HasControls()

サーバー コントロールに子コントロールが含まれているかどうかを確認します。

(継承元 Control)
HasEvents()

コントロールまたは子コントロールに対してイベントが登録されているかどうかを示す値を返します。

(継承元 Control)
IsLiteralContent()

サーバー コントロールがリテラルな内容だけを保持しているかどうかを決定します。

(継承元 Control)
LoadControlState(Object)

SaveControlState() メソッドによって保存された前回のページ要求からコントロールの状態情報を復元します。

(継承元 Control)
LoadViewState(Object)

SaveViewState() メソッドで保存された前の要求からビュー ステート情報を復元します。

(継承元 WebControl)
MapPathSecure(String)

仮想パス (絶対パスまたは相対パス) の割り当て先の物理パスを取得します。

(継承元 Control)
MarkAsDataBound()

ビューステートのコントロールの状態を、データに正常にバインドされた状態に設定します。

MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
MergeStyle(Style)

指定したスタイルの空白以外の要素を Web コントロールにコピーしますが、コントロールの既存のスタイル要素は上書きしません。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
OnBubbleEvent(Object, EventArgs)

サーバー コントロールのイベントをページの UI サーバー コントロールの階層構造に渡すかどうかを決定します。

(継承元 Control)
OnDataBinding(EventArgs)

DataBinding イベントを発生させます。

(継承元 Control)
OnDataBound(EventArgs)

DataBound イベントを発生させます。

(継承元 BaseDataBoundControl)
OnDataPropertyChanged()

基本データ ソースの識別プロパティが変更された場合に、データ バインド コントロールをデータに再バインドするために呼び出されます。

OnDataSourceChanged(Object, EventArgs)

データ バインド コントロールに関連付けられている IHierarchicalDataSource インスタンスで DataSourceChanged イベントが発生した場合に呼び出されます。

OnInit(EventArgs)

Init イベントを処理します。

(継承元 BaseDataBoundControl)
OnLoad(EventArgs)

Load イベントを処理します。

OnPagePreLoad(Object, EventArgs)

コントロールが読み込まれる前に、データ バインド コントロールの初期化された状態を設定します。

OnPreRender(EventArgs)

PreRender イベントを処理します。

(継承元 BaseDataBoundControl)
OnUnload(EventArgs)

Unload イベントを発生させます。

(継承元 Control)
OpenFile(String)

ファイルの読み込みで使用される Stream を取得します。

(継承元 Control)
PerformDataBinding()

派生クラスでオーバーライドされると、データ ソースのデータをコントロールにバインドします。

PerformSelect()

関連するデータ ソースからデータを取得します。

RaiseBubbleEvent(Object, EventArgs)

イベントのソースおよびその情報をコントロールの親に割り当てます。

(継承元 Control)
RemovedControl(Control)

Control オブジェクトの Controls コレクションから子コントロールが削除された後に呼び出されます。

(継承元 Control)
Render(HtmlTextWriter)

指定された HTML ライターにコントロールを描画します。

(継承元 WebControl)
RenderBeginTag(HtmlTextWriter)

コントロールの HTML 開始タグを指定したライターに表示します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
RenderChildren(HtmlTextWriter)

提供された HtmlTextWriter オブジェクトに対してサーバー コントロールの子のコンテンツを出力すると、クライアントで表示されるコンテンツが記述されます。

(継承元 Control)
RenderContents(HtmlTextWriter)

コントロールの内容を指定したライターに出力します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
RenderControl(HtmlTextWriter)

指定の HtmlTextWriter オブジェクトにサーバー コントロールの内容を出力し、トレースが有効である場合はコントロールに関するトレース情報を保存します。

(継承元 Control)
RenderControl(HtmlTextWriter, ControlAdapter)

指定した ControlAdapter オブジェクトを使用して、指定した HtmlTextWriter オブジェクトにサーバー コントロールの内容を出力します。

(継承元 Control)
RenderEndTag(HtmlTextWriter)

コントロールの HTML 終了タグを指定したライターに表示します。 このメソッドは、主にコントロールの開発者によって使用されます。

(継承元 WebControl)
ResolveAdapter()

指定したコントロールを表示するコントロール アダプターを取得します。

(継承元 Control)
ResolveClientUrl(String)

ブラウザーで使用できる URL を取得します。

(継承元 Control)
ResolveUrl(String)

要求側クライアントで使用できる URL に変換します。

(継承元 Control)
SaveControlState()

ページがサーバーにポスト バックされた時間以降に発生したすべてのサーバー コントロール状態の変化を保存します。

(継承元 Control)
SaveViewState()

TrackViewState() メソッドが呼び出された後に変更された状態を保存します。

(継承元 WebControl)
SetDesignModeState(IDictionary)

コントロールのデザイン時データを設定します。

(継承元 Control)
SetRenderMethodDelegate(RenderMethod)

サーバー コントロールとその内容を親コントロールに表示するイベント ハンドラー デリゲートを割り当てます。

(継承元 Control)
SetTraceData(Object, Object)

トレース データ キーとトレース データ値を使用して、レンダリング データのデザイン時トレースのトレース データを設定します。

(継承元 Control)
SetTraceData(Object, Object, Object)

トレースされたオブジェクト、トレース データ キー、およびトレース データ値を使用して、レンダリング データのデザイン時トレースのトレース データを設定します。

(継承元 Control)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)
TrackViewState()

コントロールでそのビュー ステートの変化を追跡して、その変化をオブジェクトの ViewState プロパティに保存できるようにします。

(継承元 WebControl)
ValidateDataSource(Object)

データ バインド コントロールのバインド先のオブジェクトが処理可能かどうかを確認します。

イベント

DataBinding

サーバー コントロールがデータ ソースに連結すると発生します。

(継承元 Control)
DataBound

サーバー コントロールがデータ ソースにバインドした後に発生します。

(継承元 BaseDataBoundControl)
Disposed

サーバー コントロールがメモリから解放されると発生します。これは、ASP.NET ページが要求されている場合のサーバー コントロールの有効期間における最終段階です。

(継承元 Control)
Init

サーバー コントロールが初期化されると発生します。これは、サーバー コントロールの有効期間における最初の手順です。

(継承元 Control)
Load

サーバー コントロールが Page オブジェクトに読み込まれると発生します。

(継承元 Control)
PreRender

Control オブジェクトの読み込み後、表示を開始する前に発生します。

(継承元 Control)
Unload

サーバー コントロールがメモリからアンロードされると発生します。

(継承元 Control)

明示的なインターフェイスの実装

IAttributeAccessor.GetAttribute(String)

指定された名前の Web コントロールの属性を取得します。

(継承元 WebControl)
IAttributeAccessor.SetAttribute(String, String)

Web コントロールの属性を指定された名前と値に設定します。

(継承元 WebControl)
IControlBuilderAccessor.ControlBuilder

このメンバーの詳細については、「ControlBuilder」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.GetDesignModeState()

このメンバーの詳細については、「GetDesignModeState()」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary)

このメンバーの詳細については、「SetDesignModeState(IDictionary)」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.SetOwnerControl(Control)

このメンバーの詳細については、「SetOwnerControl(Control)」をご覧ください。

(継承元 Control)
IControlDesignerAccessor.UserData

このメンバーの詳細については、「UserData」をご覧ください。

(継承元 Control)
IDataBindingsAccessor.DataBindings

このメンバーの詳細については、「DataBindings」をご覧ください。

(継承元 Control)
IDataBindingsAccessor.HasDataBindings

このメンバーの詳細については、「HasDataBindings」をご覧ください。

(継承元 Control)
IExpressionsAccessor.Expressions

このメンバーの詳細については、「Expressions」をご覧ください。

(継承元 Control)
IExpressionsAccessor.HasExpressions

このメンバーの詳細については、「HasExpressions」をご覧ください。

(継承元 Control)
IParserAccessor.AddParsedSubObject(Object)

このメンバーの詳細については、「AddParsedSubObject(Object)」をご覧ください。

(継承元 Control)

拡張メソッド

EnablePersistedSelection(BaseDataBoundControl)
古い.

選択内容とページングをサポートするデータ コントロールで選択内容の永続化を有効にします。

FindDataSourceControl(Control)

指定されたコントロールのデータ コントロールに関連付けられているデータ ソースを返します。

FindFieldTemplate(Control, String)

指定されたコントロールの名前付けコンテナー内にある、指定された列のフィールド テンプレートを返します。

FindMetaTable(Control)

格納しているデータ コントロールのメタテーブル オブジェクトを返します。

適用対象