ListControlDataBindingHandler.DataBindControl メソッドとは? わかりやすく解説

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

ListControlDataBindingHandler.DataBindControl メソッド

指定したコントロールでのデータ連結実行します

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

Public Overrides Sub DataBindControl
 ( _
    designerHost As IDesignerHost, _
    control As Control _
)
Dim instance As ListControlDataBindingHandler
Dim designerHost As IDesignerHost
Dim control As Control

instance.DataBindControl(designerHost, control)
public override void DataBindControl (
    IDesignerHost designerHost,
    Control control
)
public:
virtual void DataBindControl (
    IDesignerHost^ designerHost, 
    Control^ control
) override
public void DataBindControl (
    IDesignerHost designerHost, 
    Control control
)
public override function DataBindControl (
    designerHost : IDesignerHost, 
    control : Control
)

パラメータ

designerHost

コントロール含んでいるドキュメントの IDesignerHost。

control

連結する Control

解説解説

control によって指定された ListControl コントロールが、DataBindings プロパティ指定されデータ ソースを持つ場合DataBindControl メソッドは、ListControlItems コレクションクリアし、ListControlItems コレクションデータ バインドされていることを示す文字メッセージ追加します

使用例使用例

DataBindControl メソッドオーバーライドして、このコントロールデータ バインドされたときに関連付けられている SimpleRadioButtonList コントロールに文字メッセージ追加する方法次のコード例示します

このコード例は、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
// 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
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ListControlDataBindingHandler クラス
ListControlDataBindingHandler メンバ
System.Web.UI.Design.WebControls 名前空間
ListControl
Items
DataBindings
DataBindingHandler.DataBindControl
その他の技術情報
ASP.NET コントロール デザイナ概要



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

辞書ショートカット

すべての辞書の索引

ListControlDataBindingHandler.DataBindControl メソッドのお隣キーワード
検索ランキング

   

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



ListControlDataBindingHandler.DataBindControl メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS