BaseDataBoundControl.IsBoundUsingDataSourceID プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > BaseDataBoundControl.IsBoundUsingDataSourceID プロパティの意味・解説 

BaseDataBoundControl.IsBoundUsingDataSourceID プロパティ

メモ : このプロパティは、.NET Framework version 2.0 で新しく追加されたものです。

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

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

Protected ReadOnly Property
 IsBoundUsingDataSourceID As Boolean
Dim value As Boolean

value = Me.IsBoundUsingDataSourceID
protected bool IsBoundUsingDataSourceID { get;
 }
protected:
property bool IsBoundUsingDataSourceID {
    bool get ();
}
/** @property */
protected boolean get_IsBoundUsingDataSourceID ()
protected function get IsBoundUsingDataSourceID
 () : boolean

プロパティ値
DataSourceID プロパティに String.Empty 以外の値が設定されている場合は true が返されます。これ以外の場合は false が返されます。

解説解説

GridView、DetailsView、FormView、および Menu などのコントロールは、IsBoundUsingDataSourceID プロパティを使用して、データ バインド コントロールが ObjectDataSource または SqlDataSource などの ASP.NET 2.0 データ ソース コントロールにバインドされているかどうかを判断します。

使用例使用例

次のコード例では、派生データ バインド コントロール クラスで IsBoundUsingDataSourceID プロパティを使用する方法を示します。PerformSelect メソッドの実装では、DataBinding イベントを発生させる必要があるかどうか判断するために、IsBoundUsingDataSourceID プロパティを使用しています。このコード例は、DataBoundControl クラスのトピックで取り上げているコード例の一部分です。

Protected Overrides Sub
 PerformSelect()

    ' Call OnDataBinding here if bound to a data source using the 
    ' DataSource property (instead of a DataSourceID) because the 
    ' data-binding statement is evaluated before the call to GetData.
    If Not IsBoundUsingDataSourceID Then
        OnDataBinding(EventArgs.Empty)
    End If

    ' The GetData method retrieves the DataSourceView object from the
 
    ' IDataSource associated with the data-bound control.          
  
    GetData().Select(CreateDataSourceSelectArguments(), _
        AddressOf OnDataSourceViewSelectCallback)

    ' The PerformDataBinding method has completed.
    RequiresDataBinding = False
    MarkAsDataBound()

    ' Raise the DataBound event.
        OnDataBound(EventArgs.Empty)

End Sub 'PerformSelect

protected override void PerformSelect() { 
           

   // Call OnDataBinding here if bound to a data source using the
   // DataSource property (instead of a DataSourceID), because the
   // databinding statement is evaluated before the call to GetData.
       
    if (! IsBoundUsingDataSourceID) {
        OnDataBinding(EventArgs.Empty);
    }            
    
    // The GetData method retrieves the DataSourceView object from 
 
    // the IDataSource associated with the data-bound control.     
       
    GetData().Select(CreateDataSourceSelectArguments(), 
        OnDataSourceViewSelectCallback);
    
    // The PerformDataBinding method has completed.
    RequiresDataBinding = false;
    MarkAsDataBound();
    
    // Raise the DataBound event.
    OnDataBound(EventArgs.Empty);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
BaseDataBoundControl クラス
BaseDataBoundControl メンバ
System.Web.UI.WebControls 名前空間
ObjectDataSource
SqlDataSource



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

BaseDataBoundControl.IsBoundUsingDataSourceID プロパティのお隣キーワード
検索ランキング

   

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



BaseDataBoundControl.IsBoundUsingDataSourceID プロパティのページの著作権

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

©2026 GRAS Group, Inc.RSS