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

ListControlDataBindingHandler クラス

ビジュアル デザイナ内で ListControl Web サーバー コントロールのデータ バインディングを実行します。

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

Public Class ListControlDataBindingHandler
    Inherits DataBindingHandler
Dim instance As ListControlDataBindingHandler
public class ListControlDataBindingHandler
 : DataBindingHandler
public ref class ListControlDataBindingHandler
 : public DataBindingHandler
public class ListControlDataBindingHandler
 extends DataBindingHandler
public class ListControlDataBindingHandler
 extends DataBindingHandler
解説解説

ListControlDataBindingHandler クラスは、ListControl コントロールのデザイン時データ バインディングを実行します。ListControlDataBindingHandler クラスは、DataBindingHandlerAttribute クラスを使用して ListControl によって参照されます。

DataBindControl メソッドは、デザイン時データ バインディングを実行します。

使用例使用例

このセクションには、2 つのコード例が含まれています。1 つ目のコード例では、RadioButtonList コントロールからコントロールを派生してデータ バインディング ハンドラに関連付ける例を示します。2 つ目のコード例では、ListControlDataBindingHandler クラスからクラスを派生する例を示します。

RadioButtonList コントロールから SimpleRadioButtonList コントロールを派生し、DataBindingHandlerAttribute 属性を適用して SimpleRadioButtonList コントロールをデータ バインディング ハンドラの SimpleRadioButtonListDataBindingHandler クラスに関連付ける方法を次のコード例に示します。

Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.ComponentModel
Imports System.Security.Permissions

Namespace Examples.VB.WebControls.Design

    ' The SimpleRadioButtonList is a copy of the RadioButtonList.
    ' It uses the SimpleRadioButtonListDesigner for design-time support.
    <AspNetHostingPermission(SecurityAction.Demand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
    <AspNetHostingPermission(SecurityAction.InheritanceDemand, _
        Level:=AspNetHostingPermissionLevel.Minimal)> _
    <DesignerAttribute(GetType(Examples.VB.WebControls.Design.
 _
        SimpleRadioButtonListDesigner))> _
    <DataBindingHandler(GetType(Examples.VB.WebControls.Design.
 _
        SimpleRadioButtonListDataBindingHandler))> _
    Public Class SimpleRadioButtonList
        Inherits RadioButtonList
    End Class ' SimpleRadioButtonList
End Namespace ' Examples.VB.WebControls.Design
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Security.Permissions;

namespace Examples.CS.WebControls.Design
{
    // The SimpleRadioButtonList is a copy of the RadioButtonList.
    // It uses the SimpleRadioButtonListDesigner for design-time support.
    [AspNetHostingPermission(SecurityAction.Demand, 
        Level = AspNetHostingPermissionLevel.Minimal)]
    [AspNetHostingPermission(SecurityAction.InheritanceDemand, 
        Level = AspNetHostingPermissionLevel.Minimal)]
    [Designer(typeof(Examples.CS.WebControls.Design.
       SimpleRadioButtonListDesigner))]
    [DataBindingHandler(typeof(Examples.CS.WebControls.Design.
        SimpleRadioButtonListDataBindingHandler))]
    public class SimpleRadioButtonList : RadioButtonList
    {
    } // SimpleRadioButtonList
} // Examples.CS.WebControls.Design

ListControlDataBindingHandler クラスから SimpleRadioButtonListDataBindingHandler クラスを派生する方法を次のコード例に示します。このコードは、DataBindControl メソッドをオーバーライドして、このコントロールがデータ バインドされたときに関連付けられている SimpleRadioButtonList コントロールにメッセージを追加します。

' Imports System.Design
Imports System
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Web.UI
Imports System.Web.UI.Design.WebControls

Namespace Examples.VB.WebControls.Design

    ' Derive the SimpleRadioButtonListDataBindingHandler.
    Public Class SimpleRadioButtonListDataBindingHandler
        Inherits ListControlDataBindingHandler

        ' Override the DataBindControl.
        Public Overrides Sub
 DataBindControl( _
        ByVal designerHost As IDesignerHost,
 _
        ByVal control As Control)

            ' Create a reference, named dataSourceBinding,
            ' to the control's DataSource binding.
            Dim dataSourceBinding As DataBinding
 _
                = CType( _
                control, _
                IDataBindingsAccessor).DataBindings("DataSource")

            ' If the binding exists, create a reference to the
            ' list control, clear its ListItemCollection, and then add
            ' an item to the collection.
            If Not (dataSourceBinding Is
 Nothing) Then
                Dim simpleControl As SimpleRadioButtonList
 = _
                    CType(control, SimpleRadioButtonList)

                simpleControl.Items.Clear()
                simpleControl.Items.Add("Data-bound Radio Button.")
            End If
        End Sub ' DataBindControl
    End Class ' SimpleRadioButtonListDataBindingHandler
End Namespace ' Examples.VB.WebControls.Design
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Web.UI;
using System.Web.UI.Design.WebControls;

namespace Examples.CS.WebControls.Design
{
    // Derive the SimpleRadioButtonListDataBindingHandler.
    public class SimpleRadioButtonListDataBindingHandler
 : 
        ListControlDataBindingHandler
    {
        // Override the DataBindControl. 
        public override void DataBindControl(IDesignerHost
 designerHost, 
            Control control)
        {
            // Create a reference, named dataSourceBinding, 
            // to the control DataSource binding.
            DataBinding dataSourceBinding = 
                ((IDataBindingsAccessor)control).DataBindings["DataSource"];

            // If the binding exists, create a reference to the
            // list control, clear its ListItemCollection, and then
 add
            // an item to the collection.
            if (! (dataSourceBinding == null))
            {
                SimpleRadioButtonList simpleControl = 
                    (SimpleRadioButtonList)control;

                simpleControl.Items.Clear();
                simpleControl.Items.Add("Data-bound Radio Button.");
            }
        } // DataBindControl
    } // SimpleRadioButtonListDataBindingHandler
} // Examples.CS.WebControls.Design
.NET Framework のセキュリティ.NET Framework のセキュリティ
継承階層継承階層
System.Object
   System.Web.UI.Design.DataBindingHandler
    System.Web.UI.Design.WebControls.ListControlDataBindingHandler
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ListControlDataBindingHandler コンストラクタ

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

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

Dim instance As New ListControlDataBindingHandler
public ListControlDataBindingHandler ()
public:
ListControlDataBindingHandler ()
public ListControlDataBindingHandler ()
public function ListControlDataBindingHandler
 ()
解説解説

.NET Framework は、ListControlDataBindingHandler クラスが DataBindingHandlerAttribute 属性によって参照されたときに、このクラスの新しいインスタンスを内部的に生成します。

.NET Framework のセキュリティ.NET Framework のセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ListControlDataBindingHandler クラス
ListControlDataBindingHandler メンバ
System.Web.UI.Design.WebControls 名前空間
ListControl
ListControlDesigner
DataBindingHandler クラス
DataBindingHandlerAttribute
その他の技術情報
ASP.NET コントロール デザイナの概要

ListControlDataBindingHandler メソッド


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

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ListControlDataBindingHandler クラス
System.Web.UI.Design.WebControls 名前空間
ListControl
ListControlDesigner
DataBindingHandler クラス
DataBindingHandlerAttribute

その他の技術情報

ASP.NET コントロール デザイナの概要
チュートリアル : Web サーバー コントロール用の基本的なコントロール デザイナの作成
デザイン時サポートの拡張
方法 : デザイン モードでコントロールの外観と動作を拡張する

ListControlDataBindingHandler メンバ

ビジュアル デザイナ内で ListControl Web サーバー コントロールのデータ バインディングを実行します。

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


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド ListControlDataBindingHandler ListControlDataBindingHandler クラスの新しいインスタンスを初期化します。
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

ListControlDataBindingHandler クラス
System.Web.UI.Design.WebControls 名前空間
ListControl
ListControlDesigner
DataBindingHandler クラス
DataBindingHandlerAttribute

その他の技術情報

ASP.NET コントロール デザイナの概要
チュートリアル : Web サーバー コントロール用の基本的なコントロール デザイナの作成
デザイン時サポートの拡張
方法 : デザイン モードでコントロールの外観と動作を拡張する



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「ListControlDataBindingHandler」の関連用語

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

   

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



ListControlDataBindingHandlerのページの著作権

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

©2026 GRAS Group, Inc.RSS