HierarchicalDataBoundControlAdapter クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HierarchicalDataBoundControlAdapter クラスの意味・解説 

HierarchicalDataBoundControlAdapter クラス

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

このコントロール アダプタ関連付けられている HierarchicalDataBoundControl オブジェクトの、特定のブラウザ要求対す動作カスタマイズます。

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

Public Class HierarchicalDataBoundControlAdapter
    Inherits WebControlAdapter
Dim instance As HierarchicalDataBoundControlAdapter
public class HierarchicalDataBoundControlAdapter
 : WebControlAdapter
public ref class HierarchicalDataBoundControlAdapter
 : public WebControlAdapter
public class HierarchicalDataBoundControlAdapter
 extends WebControlAdapter
public class HierarchicalDataBoundControlAdapter
 extends WebControlAdapter
解説解説

HierarchicalDataBoundControlAdapter クラスは、関連付けられた HierarchicalDataBoundControl コントロール調整し特定のブラウザ対す既定マークアップまたは動作変更しますHierarchicalDataBoundControlAdapter クラス拡張することにより、HierarchicalDataBoundControl コントロール表示より詳細カスタマイズできます

HierarchicalDataBoundControl コントロールは、データ ソースバインドされ、バインド先のデータ ソース内の項目を列挙することによって、ユーザー インターフェイス (または、通常、子コントロール階層) を生成します階層構造データ バインド コントロール詳細については、HierarchicalDataBoundControlトピック参照してください

コントロール アダプタは、特定のブラウザ対すコントロール有効期間1 つ上の段階管理する .NET コンポーネントです。HierarchicalDataBoundControlAdapter クラス拡張すると、HierarchicalDataBoundControl コントロール有効期間段階アクセスできます詳細については、「アダプティブ コントロール動作アーキテクチャの概要」を参照してください

アダプタ初期要求により、要求側のブラウザ特性に応じてコントロール割り当てられアダプタ.NET Framework によって検索されます。ブラウザ定義ファイルは、HttpBrowserCapabilities クラス使用されクライアント ブラウザ特性識別したり、アダプタブラウザ種類対応付けりします

使用例使用例

HierarchicalDataBoundControlAdapter クラス拡張して、XmlDataSource オブジェクトバインドされた階層構造の TreeView コントロール表示する方法の例を次に示します

このコード例には、4 つオブジェクト含まれています。

このコード例は、4 つコード セグメント構成されています。最初コード セグメントは、HierarchicalDataBoundControlAdapter クラス拡張する方法示してます。

Imports System
Imports System.Web
Imports System.Security.Permissions

Namespace Contoso

    <AspNetHostingPermission(SecurityAction.Demand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
    <AspNetHostingPermission(SecurityAction.InheritanceDemand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
    Public Class HierarchicalTreeViewAdapter
        Inherits _
        System.Web.UI.WebControls.Adapters.HierarchicalDataBoundControlAdapter

        ' Return a strongly-typed TreeView control for adapter.
        Protected Overloads ReadOnly
 Property Control() As _
            System.Web.UI.WebControls.TreeView

            Get
                Return CType( _
                    MyBase.Control, _
                    System.Web.UI.WebControls.TreeView)
            End Get
        End Property

        ' Verify the DataSourceID property is set prior to binding data.
        Protected Overrides Sub
 PerformDataBinding()

            If (Not Control.DataSourceID Is
 Nothing) Then

                MyBase.PerformDataBinding()
            End If
        End Sub
    End Class
End Namespace
using System;
using System.Web;
using System.Web.UI;
using System.Security.Permissions;

namespace Contoso
{
    [AspNetHostingPermission(
        SecurityAction.Demand, 
        Level = AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(
        SecurityAction.InheritanceDemand, 
        Level = AspNetHostingPermissionLevel.Minimal)]
    public class HierarchicalTreeViewAdapter
 :
        System.Web.UI.WebControls.Adapters.HierarchicalDataBoundControlAdapter
    {
        // Return a strongly-typed TreeView control for adapter.
        protected new System.Web.UI.WebControls.TreeView
 Control
        {
            get
            {
                return (System.Web.UI.WebControls.TreeView)base.Control;
            }
        }

        // Verify the DataSourceID property is set prior to binding
 data.
        protected override void PerformDataBinding()
        {
            if (Control.DataSourceID != null)
            {
                base.PerformDataBinding();
            }
        }
    }
}

2 番目のコード セグメントは、TreeView宣言して XML データ ソースバインドする方法示してます。

<%@ page language="VB" %>

<html>
<head runat="server">
    <title>HierarchicalDataBoundControl Adapter</title>
</head>
<body>
    <form id="Form1" runat="server">
        <asp:TreeView ID="TreeView1" 
            Runat="server" 
            DataSourceID="XmlDataSource1">

            <DataBindings>
                <asp:TreeNodeBinding    
                    DataMember="employees" Text="Employees"/>
                <asp:TreeNodeBinding    
                    DataMember="employee" TextField="id"
 />
                <asp:TreeNodeBinding    
                    DataMember="name" TextField="fullname"
 />
            </DataBindings>
        </asp:TreeView>
        
        <asp:XmlDataSource ID="XmlDataSource1"
  
            Runat="server" 
            DataFile="employees.xml" />
        <br />
    </form>
</body>
</html>
<%@ page language="c#" %>

<html>
<head runat="server">
    <title>HierarchicalDataBoundControl Adapter</title>
</head>
<body>
    <form id="Form1" runat="server">
        <asp:TreeView ID="TreeView1" 
            Runat="server" 
            DataSourceID="XmlDataSource1">

            <DataBindings>
                <asp:TreeNodeBinding    
                    DataMember="employees" Text="Employees"/>
                <asp:TreeNodeBinding    
                    DataMember="employee" TextField="id" />
                <asp:TreeNodeBinding    
                    DataMember="name" TextField="fullname" />
            </DataBindings>
        </asp:TreeView>
        
        <asp:XmlDataSource ID="XmlDataSource1"  
            Runat="server" 
            DataFile="employees.xml" />
        <br />
    </form>
</body>
</html>

3 番目のコード セグメントは、TreeView コントロールを、Windows CE 上で実行するブラウザカスタム アダプタリンクさせる方法示してます。

<browsers>
    <browser refID="WinCE">
        <controlAdapters>
            <adapter controlType="System.Web.UI.WebControls.TreeView"
 
                adapterType="Contoso.HierarchicalTreeViewAdapter"
 />
        </controlAdapters>
    </browser>
    <browser refID="IE">
        <controlAdapters>
            <adapter controlType="System.Web.UI.WebControls.TreeView"
 
                adapterType="Contoso.HierarchicalTreeViewAdapter"
 />
        </controlAdapters>
    </browser>
</browsers>
<browsers>
    <browser refID="WinCE">
        <controlAdapters>
            <adapter controlType="System.Web.UI.WebControls.TreeView"
 
                adapterType="Contoso.HierarchicalTreeViewAdapter" />
        </controlAdapters>
    </browser>
    <browser refID="IE">
        <controlAdapters>
            <adapter controlType="System.Web.UI.WebControls.TreeView"
 
                adapterType="Contoso.HierarchicalTreeViewAdapter" />
        </controlAdapters>
    </browser>
</browsers>

最後コード セグメントには、TreeView コントロールバインド先の XML データ含まれています。

<?xml version="1.0" encoding="utf-8"
 ?>
<employees>
    <employee id="100001">
        <name fullName="Panduro, Stig" />
    </employee>
    <employee id="100002">
        <name fullName="Haas, Jonathan" />
    </employee>
    <employee id="100003">
        <name fullName="Pearson, Simon" />
    </employee>
</employees>
<?xml version="1.0" encoding="utf-8" ?>
<employees>
    <employee id="100001">
        <name fullName="Panduro, Stig" />
    </employee>
    <employee id="100002">
        <name fullName="Haas, Jonathan" />
    </employee>
    <employee id="100003">
        <name fullName="Pearson, Simon" />
    </employee>
</employees>
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
   System.Web.UI.Adapters.ControlAdapter
     System.Web.UI.WebControls.Adapters.WebControlAdapter
      System.Web.UI.WebControls.Adapters.HierarchicalDataBoundControlAdapter
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HierarchicalDataBoundControlAdapter メンバ
System.Web.UI.WebControls.Adapters 名前空間
WebControlAdapter
HierarchicalDataBoundControl クラス
XmlDataSource クラス
TreeView クラス
AspNetHostingPermission
HttpBrowserCapabilities
その他の技術情報
アダプティブ コントロール動作アーキテクチャの概要



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

辞書ショートカット

すべての辞書の索引

「HierarchicalDataBoundControlAdapter クラス」の関連用語

HierarchicalDataBoundControlAdapter クラスのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS