BindingSource イベント

名前 | 説明 | |
---|---|---|
![]() | AddingNew | 項目が基底のリストに追加される前に発生します。 |
![]() | BindingComplete | すべてのクライアントがこの BindingSource にバインドされたときに発生します。 |
![]() | CurrentChanged | 現在バインドされている項目が変更された場合に発生します。 |
![]() | CurrentItemChanged | Current プロパティのプロパティ値が変更された場合に発生します。 |
![]() | DataError | 現在性に関する例外が BindingSource によって表示されずに処理された場合に発生します。 |
![]() | DataMemberChanged | DataMember プロパティの値が変更された場合に発生します。 |
![]() | DataSourceChanged | DataSource プロパティの値が変更された場合に発生します。 |
![]() | Disposed | コンポーネントの Disposed イベントを待機するイベント ハンドラを追加します。 ( Component から継承されます。) |
![]() | ListChanged | 基底のリストまたはリスト内の項目が変更された場合に発生します。 |
![]() | PositionChanged | Position プロパティの値が変更された後に発生します。 |

BindingSource クラス
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Public Class BindingSource Inherits Component Implements IBindingListView, IBindingList, IList, ICollection, _ IEnumerable, ITypedList, ICancelAddNew, ISupportInitializeNotification, ISupportInitialize, _ ICurrencyManagerProvider
public class BindingSource : Component, IBindingListView, IBindingList, IList, ICollection, IEnumerable, ITypedList, ICancelAddNew, ISupportInitializeNotification, ISupportInitialize, ICurrencyManagerProvider
public ref class BindingSource : public Component, IBindingListView, IBindingList, IList, ICollection, IEnumerable, ITypedList, ICancelAddNew, ISupportInitializeNotification, ISupportInitialize, ICurrencyManagerProvider

BindingSource コンポーネントは、2 つの目的を果たします。1 つは、間接層、通貨管理、変更通知、およびその他のサービスを提供して、フォーム上のコントロールのデータへのバインディングを簡素化することです。これは、BindingSource コンポーネントをデータ ソースに結びつけ、フォーム上のコントロールを BindingSource コンポーネントにバインディングすることによって達成されます。以降のデータとの対話 (移動、並べ替え、フィルタ処理、更新など) は、BindingSource コンポーネントを呼び出すことによって実行します。
BindingSource コンポーネントが果たすもう 1 つの目的は、厳密に型指定されたデータ ソースとして機能することです。基底のデータ ソースの型は、通常、次の機構のうちいずれかを通じて固定されます。
どちらの機構を使用しても、厳密に型指定されたリストが作成されます。BindingSource は、DataSource プロパティと DataMember プロパティの設定に従い、単純データ バインディングと複合データ バインディングの両方をサポートします。
![]() |
---|
BindingSource クラスの多くのメンバは、List プロパティで表される基底のリストの下で機能し、その操作を基底のリストに委託するだけです。このため、BindingSource を IList のカスタム実装とバインドした場合、これらのメンバの動作は、クラスのドキュメントに記載されている動作と厳密には異なる場合があります。たとえば、RemoveAt メソッドは、IList.RemoveAt を呼び出します。BindingSource のドキュメントにおける RemoveAt メソッドの説明は、基になる IList の RemoveAt メソッドが正しく実装されていることを前提としています。 |

BindingSource に ListBox をバインドするコード例を次に示します。BindingSource が、フォント一覧を保持する BindingList にバインドされます。
Imports System Imports System.Collections.Generic Imports System.ComponentModel Imports System.Drawing Imports System.Text Imports System.Windows.Forms Public Class Form1 Inherits Form <STAThread()> _ Shared Sub Main() Application.EnableVisualStyles() Application.Run(New Form1()) End Sub Public Sub New() End Sub Private textBox1 As TextBox Private WithEvents button1 As Button Private listBox1 As ListBox Private components As IContainer Private binding1 As BindingSource Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load listBox1 = New ListBox() textBox1 = New TextBox() binding1 = New BindingSource() button1 = New Button() listBox1.Location = New Point(140, 25) listBox1.Size = New Size(123, 160) textBox1.Location = New Point(23, 70) textBox1.Size = New Size(100, 20) textBox1.Text = "Wingdings" button1.Location = New Point(23, 25) button1.Size = New Size(75, 23) button1.Text = "Search" Me.ClientSize = New Size(292, 266) Me.Controls.Add(Me.button1) Me.Controls.Add(Me.textBox1) Me.Controls.Add(Me.listBox1) Dim fonts As New MyFontList() Dim i As Integer For i = 0 To FontFamily.Families.Length - 1 If FontFamily.Families(i).IsStyleAvailable(FontStyle.Regular) Then fonts.Add(New Font(FontFamily.Families(i), 11.0F, FontStyle.Regular)) End If Next i binding1.DataSource = fonts listBox1.DataSource = binding1 listBox1.DisplayMember = "Name" End Sub Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) _ Handles button1.Click If binding1.SupportsSearching <> True Then MessageBox.Show("Cannot search the list.") Else Dim foundIndex As Integer = binding1.Find("Name", textBox1.Text) If foundIndex > -1 Then listBox1.SelectedIndex = foundIndex Else MessageBox.Show("Font was not found.") End If End If End Sub End Class Public Class MyFontList Inherits BindingList(Of Font) Protected Overrides ReadOnly Property SupportsSearchingCore() As Boolean Get Return True End Get End Property Protected Overrides Function FindCore(ByVal prop As PropertyDescriptor, _ ByVal key As Object) As Integer ' Ignore the prop value and search by family name. Dim i As Integer While i < Count If Items(i).FontFamily.Name.ToLower() = CStr(key).ToLower() Then Return i End If i += 1 End While Return -1 End Function End Class

System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.BindingSource


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


BindingSource コンストラクタ ()
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


次の表に、このコンストラクタで初期化される BindingSource の既定のプロパティ値を示します。
DataSource | null 参照 (Visual Basic では Nothing) |
DataMember | |
null 参照 (Visual Basic では Nothing) | |
null 参照 (Visual Basic では Nothing) | |
RaiseListChangedEvents |

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


BindingSource コンストラクタ (IContainer)
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


このコンストラクタは、既定のコンストラクタを呼び出した上で、現在の BindingSource を指定したコンテナに追加します。このコンストラクタは、通常、ソリューション プログラマが使用することはなく、デザイン時環境の作成者が使用します。

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


BindingSource コンストラクタ (Object, String)
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim dataSource As Object Dim dataMember As String Dim instance As New BindingSource(dataSource, dataMember)
- dataSource
BindingSource のデータ ソース。

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


BindingSource コンストラクタ

名前 | 説明 |
---|---|
BindingSource () | BindingSource クラスの新しいインスタンスを既定のプロパティ値で初期化します。 .NET Compact Framework によってサポートされています。 |
BindingSource (IContainer) | BindingSource クラスの新しいインスタンスを初期化し、その BindingSource を指定したコンテナに追加します。 .NET Compact Framework によってサポートされています。 |
BindingSource (Object, String) | データ ソースとデータ メンバを指定して、BindingSource クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |

関連項目
BindingSource クラスBindingSource メンバ
System.Windows.Forms 名前空間
DataSource
DataMember
CurrencyManager
BindingSource プロパティ

名前 | 説明 | |
---|---|---|
![]() ![]() ![]() ![]() | Container | Component を格納している IContainer を取得します。 ( Component から継承されます。) |
![]() | Site | Component の ISite を取得または設定します。 ( Component から継承されます。) |
![]() | SyncRoot | 基になるリストへのアクセスを同期するために使用できるオブジェクトを取得します。 |

名前 | 説明 | |
---|---|---|
![]() | CanRaiseEvents | コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。 ( Component から継承されます。) |
![]() | DesignMode | Component が現在デザイン モードかどうかを示す値を取得します。 ( Component から継承されます。) |
![]() | Events | Component に結び付けられているイベント ハンドラのリストを取得します。 ( Component から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.ComponentModel.ISupportInitializeNotification.IsInitialized | BindingSource が初期化されているかどうかを示す値を取得します。 |

BindingSource メソッド


名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 オーバーライドされます。 BindingSource によって使用されているすべてのリソースを解放します。 |
![]() | Finalize | Component がガベージ コレクションによってクリアされる前に、アンマネージ リソースを解放し、その他のクリーンアップ操作を実行します。 ( Component から継承されます。) |
![]() | GetService | Component またはその Container で提供されるサービスを表すオブジェクトを返します。 ( Component から継承されます。) |
![]() | MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |
![]() | OnAddingNew | AddingNew イベントを発生させます。 |
![]() | OnBindingComplete | BindingComplete イベントを発生させます。 |
![]() | OnCurrentChanged | CurrentChanged イベントを発生させます。 |
![]() | OnCurrentItemChanged | CurrentItemChanged イベントを発生させます。 |
![]() | OnDataError | DataError イベントを発生させます。 |
![]() | OnDataMemberChanged | DataMemberChanged イベントを発生させます。 |
![]() | OnDataSourceChanged | DataSourceChanged イベントを発生させます。 |
![]() | OnListChanged | ListChanged イベントを発生させます。 |
![]() | OnPositionChanged | PositionChanged イベントを発生させます。 |

名前 | 説明 | |
---|---|---|
![]() | System.ComponentModel.IBindingList.AddIndex | 検索に使用されるインデックスに PropertyDescriptor を追加します。 |
![]() | System.ComponentModel.IBindingList.RemoveIndex | 検索に使用されるインデックスから System.ComponentModel.PropertyDescriptor を削除します。 |
![]() | System.ComponentModel.ICancelAddNew.CancelNew | 保留中の新しい項目をコレクションから破棄します。 |
![]() | System.ComponentModel.ICancelAddNew.EndNew | 保留中の新しい項目をコレクションにコミットします。 |
![]() | System.ComponentModel.ISupportInitialize.BeginInit | 初期化の開始を通知するシグナルを BindingSource に送信します。 |
![]() | System.ComponentModel.ISupportInitialize.EndInit | 初期化の完了を通知するシグナルを BindingSource に送信します。 |

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


名前 | 説明 | |
---|---|---|
![]() ![]() ![]() ![]() | Container | Component を格納している IContainer を取得します。(Component から継承されます。) |
![]() | Site | Component の ISite を取得または設定します。(Component から継承されます。) |
![]() | SyncRoot | 基になるリストへのアクセスを同期するために使用できるオブジェクトを取得します。 |

名前 | 説明 | |
---|---|---|
![]() | CanRaiseEvents | コンポーネントがイベントを発生させることがきるかどうかを示す値を取得します。(Component から継承されます。) |
![]() | DesignMode | Component が現在デザイン モードかどうかを示す値を取得します。(Component から継承されます。) |
![]() | Events | Component に結び付けられているイベント ハンドラのリストを取得します。(Component から継承されます。) |


名前 | 説明 | |
---|---|---|
![]() | Dispose | オーバーロードされます。 オーバーライドされます。 BindingSource によって使用されているすべてのリソースを解放します。 |
![]() | Finalize | Component がガベージ コレクションによってクリアされる前に、アンマネージ リソースを解放し、その他のクリーンアップ操作を実行します。 (Component から継承されます。) |
![]() | GetService | Component またはその Container で提供されるサービスを表すオブジェクトを返します。 (Component から継承されます。) |
![]() | MemberwiseClone | オーバーロードされます。 ( MarshalByRefObject から継承されます。) |
![]() | OnAddingNew | AddingNew イベントを発生させます。 |
![]() | OnBindingComplete | BindingComplete イベントを発生させます。 |
![]() | OnCurrentChanged | CurrentChanged イベントを発生させます。 |
![]() | OnCurrentItemChanged | CurrentItemChanged イベントを発生させます。 |
![]() | OnDataError | DataError イベントを発生させます。 |
![]() | OnDataMemberChanged | DataMemberChanged イベントを発生させます。 |
![]() | OnDataSourceChanged | DataSourceChanged イベントを発生させます。 |
![]() | OnListChanged | ListChanged イベントを発生させます。 |
![]() | OnPositionChanged | PositionChanged イベントを発生させます。 |

名前 | 説明 | |
---|---|---|
![]() | AddingNew | 項目が基底のリストに追加される前に発生します。 |
![]() | BindingComplete | すべてのクライアントがこの BindingSource にバインドされたときに発生します。 |
![]() | CurrentChanged | 現在バインドされている項目が変更された場合に発生します。 |
![]() | CurrentItemChanged | Current プロパティのプロパティ値が変更された場合に発生します。 |
![]() | DataError | 現在性に関する例外が BindingSource によって表示されずに処理された場合に発生します。 |
![]() | DataMemberChanged | DataMember プロパティの値が変更された場合に発生します。 |
![]() | DataSourceChanged | DataSource プロパティの値が変更された場合に発生します。 |
![]() | Disposed | コンポーネントの Disposed イベントを待機するイベント ハンドラを追加します。(Component から継承されます。) |
![]() | ListChanged | 基底のリストまたはリスト内の項目が変更された場合に発生します。 |
![]() | PositionChanged | Position プロパティの値が変更された後に発生します。 |

名前 | 説明 | |
---|---|---|
![]() | System.ComponentModel.IBindingList.AddIndex | 検索に使用されるインデックスに PropertyDescriptor を追加します。 |
![]() | System.ComponentModel.IBindingList.RemoveIndex | 検索に使用されるインデックスから System.ComponentModel.PropertyDescriptor を削除します。 |
![]() | System.ComponentModel.ICancelAddNew.CancelNew | 保留中の新しい項目をコレクションから破棄します。 |
![]() | System.ComponentModel.ICancelAddNew.EndNew | 保留中の新しい項目をコレクションにコミットします。 |
![]() | System.ComponentModel.ISupportInitialize.BeginInit | 初期化の開始を通知するシグナルを BindingSource に送信します。 |
![]() | System.ComponentModel.ISupportInitialize.EndInit | 初期化の完了を通知するシグナルを BindingSource に送信します。 |
![]() | System.ComponentModel.ISupportInitializeNotification.Initialized | BindingSource が初期化されるときに発生します。 |

Weblioに収録されているすべての辞書からBindingSourceを検索する場合は、下記のリンクをクリックしてください。

- BindingSourceのページへのリンク