BindingSource 類別

定義

封裝表單的資料來源。Encapsulates the data source for a form.

public ref class BindingSource : System::ComponentModel::Component, System::Collections::IList, System::ComponentModel::IBindingListView, System::ComponentModel::ICancelAddNew, System::ComponentModel::ISupportInitializeNotification, System::ComponentModel::ITypedList, System::Windows::Forms::ICurrencyManagerProvider
[System.ComponentModel.ComplexBindingProperties("DataSource", "DataMember")]
public class BindingSource : System.ComponentModel.Component, System.Collections.IList, System.ComponentModel.IBindingListView, System.ComponentModel.ICancelAddNew, System.ComponentModel.ISupportInitializeNotification, System.ComponentModel.ITypedList, System.Windows.Forms.ICurrencyManagerProvider
type BindingSource = class
    inherit Component
    interface IBindingListView
    interface IBindingList
    interface IList
    interface ICollection
    interface IEnumerable
    interface ITypedList
    interface ICancelAddNew
    interface ISupportInitializeNotification
    interface ISupportInitialize
    interface ICurrencyManagerProvider
Public Class BindingSource
Inherits Component
Implements IBindingListView, ICancelAddNew, ICurrencyManagerProvider, IList, ISupportInitializeNotification, ITypedList
繼承
屬性
實作

範例

下列程式碼範例示範ListBox系結至的。 BindingSourceThe following code example demonstrates a ListBox bound to a BindingSource. 會系結BindingList<T>至包含字型清單的。 BindingSourceThe BindingSource is bound to a BindingList<T> that contains a list of fonts.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace BindingSourceExamples
{
    public class Form1 : Form
    {
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.Run(new Form1());
        }

        public Form1()
        {
            this.Load += new EventHandler(Form1_Load);
        }

        private TextBox textBox1;
        private Button button1;
        private ListBox listBox1;
       
        private BindingSource binding1;
        void Form1_Load(object sender, EventArgs e)
        {
            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";
            button1.Click += new EventHandler(this.button1_Click);
            this.ClientSize = new Size(292, 266);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.listBox1);

            MyFontList fonts = new MyFontList();
            for (int i = 0; i < FontFamily.Families.Length; i++)
            {
                if (FontFamily.Families[i].IsStyleAvailable(FontStyle.Regular))
                    fonts.Add(new Font(FontFamily.Families[i], 11.0F, FontStyle.Regular));
            }
            binding1.DataSource = fonts;
            listBox1.DataSource = binding1;
            listBox1.DisplayMember = "Name";

        }

  
        private void button1_Click(object sender, EventArgs e)
        {
            if (binding1.SupportsSearching != true)
                MessageBox.Show("Cannot search the list.");
            else
            {
                int foundIndex = binding1.Find("Name", textBox1.Text);
                if (foundIndex > -1)
                    listBox1.SelectedIndex = foundIndex;
                else
                    MessageBox.Show("Font was not found.");
            }
        }
    }
    
    public class MyFontList : BindingList<Font>
    {

        protected override bool SupportsSearchingCore
        {
            get { return true; }
        }
        protected override int FindCore(PropertyDescriptor prop, object key)
        {
            // Ignore the prop value and search by family name.
            for (int i = 0; i < Count; ++i)
            {
                if (Items[i].FontFamily.Name.ToLower() == ((string)key).ToLower())
                    return i;

            }
            return -1;
        }


    }
  
}
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

    Private 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

備註

BindingSource元件有許多用途。The BindingSource component serves many purposes. 首先, 它會在 Windows Forms 控制項和資料來源之間提供貨幣管理、變更通知和其他服務, 藉此簡化將表單上的控制項系結至資料的程式。First, it simplifies binding controls on a form to data by providing currency management, change notification, and other services between Windows Forms controls and data sources. 使用屬性將BindingSource元件附加至資料來源,即可完成這項作業。DataSourceThis is accomplished by attaching the BindingSource component to your data source using the DataSource property. 針對複雜的系結案例, 您可以DataMember選擇性地將屬性設定為數據源中的特定資料行或清單。For complex binding scenarios you can optionally set the DataMember property to a specific column or list in the data source. 接著, 您可以將控制項BindingSource系結至。You then bind controls to the BindingSource. 所有與資料的進一步互動都是透過呼叫BindingSource元件來完成。All further interaction with the data is accomplished with calls to the BindingSource component. 如需如何BindingSource簡化系結程式的範例, 請參閱如何:將 Windows Forms 控制項系結至 DBNull資料庫值和如何:處理資料系結時所發生的錯誤和例外狀況。For examples on how the BindingSource can simplify the binding process, see How to: Bind Windows Forms Controls to DBNull Database Values and How to: Handle Errors and Exceptions that Occur with Databinding. 資料來源的導覽和更新是透過MoveNextMoveLastRemove等方法來完成。Navigation and updating of the data source is accomplished through methods such as MoveNext, MoveLast, and Remove. 排序和篩選之類的Sort作業會透過和Filter屬性來處理。Operations such as sorting and filtering are handled through the Sort and Filter properties. 如需搭配使用排序和篩選BindingSource的詳細資訊, 請參閱如何:使用 Windows Forms BindingSource 元件排序和篩選 ADO.NET 資料。For more information on using sorting and filtering with the BindingSource, see How to: Sort and Filter ADO.NET Data with the Windows Forms BindingSource Component.

此外, 此BindingSource元件也可以做為強型別資料來源。In addition, the BindingSource component can act as a strongly typed data source. 基礎資料來源的類型通常是透過下列其中一種機制來修正:Typically the type of the underlying data source is fixed through one of the following mechanisms:

這兩種機制都會建立強型別清單。Both of these mechanisms create a strongly-typed list. 如需如何使用BindingSource來系結至類型的詳細資訊, 請參閱如何:將 Windows Forms 控制項系結至類型For more information on how to use the BindingSource to bind to a type, see How to: Bind a Windows Forms Control to a Type. 您也可以使用BindingSource將控制項系結至 factory 物件。You can also use the BindingSource to bind your controls to a factory object. 如需如何執行此動作的詳細資訊, 請參閱如何:將 Windows Forms 控制項系結至 Factory 物件For more information on how to do this, see How to: Bind a Windows Forms Control to a Factory Object.

注意

因為會BindingSource處理簡單和複雜的資料來源, 所以術語會有問題。Because a BindingSource handles both simple and complex data sources, terminology is problematic. 在此類別檔中, 「清單」一詞指的是裝載資料來源內的資料集合, 而item則代表單一元素。Within this class documentation, the term list refers to a data collection within the hosted data source, and item denotes a single element. 當討論與複雜資料來源相關聯的功能時, 會使用對等的詞彙資料表和資料When discussing functionality associated with complex data sources, the equivalent terms table and row are used.

BindingSource提供用來存取基礎資料的成員。BindingSource provides members for accessing the underlying data. 您可以透過Current屬性來抓取目前的專案, 而且可以List透過屬性來抓取整個清單。The current item can be retrieved through the Current property, and the entire list can be retrieved through the List property. Current目前的專案支援編輯作業, RemoveCurrent以及、 EndEditCancelEditAdd AddNew方法。Editing operations are supported on the current item through Current and the RemoveCurrent, EndEdit, CancelEdit and Add and AddNew methods. 雖然會針對所有基礎資料來源類型自動處理貨幣管理, 但這個類別會公開一些事件 (例如CurrentItemChangedDataSourceChanged), 以允許自訂。Although currency management is handled automatically for all underlying data source types, this class exposes a number of events, such as CurrentItemChanged and DataSourceChanged, that allow for customization.

系結至BindingSource元件的資料來源也可以BindingNavigator使用類別來導覽和管理, 它會提供類似 VCR 的使用者介面 (UI), 以瀏覽清單中的專案。Data sources that are bound to a BindingSource component can also be navigated and managed with the BindingNavigator class, which provides a VCR-like user interface (UI) for navigating items within a list. 雖然BindingNavigator可以系結至任何資料來源, 但其設計目的是要透過BindingSourceBindingNavigator.BindingSource屬性來與元件整合。Although BindingNavigator can be bound to any data source, it was designed to integrate with a BindingSource component through its BindingNavigator.BindingSource property.

BindingSource類別的預設屬性是DataSourceThe default property for the BindingSource class is DataSource. 預設事件為CurrentChangedThe default event is CurrentChanged.

警告

BindingSource類別的許多成員會在List屬性所表示的基礎清單上運作, 並直接將其作業參考到基礎清單。Many of the members of the BindingSource class operate on the underlying list represented by the List property and simply refer their operation to the underlying list. 因此, 當系BindingSource結至的自訂IList執行時, 這些成員的確切行為可能會與類別檔中所述的行為不同。Therefore, when the BindingSource is bound to a custom implementation of IList, the exact behavior of these members may differ from the behavior described in the class documentation. 例如, RemoveAt方法會呼叫IList.RemoveAtFor example, the RemoveAt method calls IList.RemoveAt. 檔描述方法, 並瞭解如何正確地IList執行基礎的方法。RemoveAt RemoveAt BindingSourceThe BindingSource documentation describes the RemoveAt method with the understanding that the RemoveAt method for the underlying IList is correctly implemented.

建構函式

BindingSource()

初始化 BindingSource 類別的新執行個體成為預設屬性值。Initializes a new instance of the BindingSource class to the default property values.

BindingSource(IContainer)

初始化 BindingSource 類別的新執行個體,並將 BindingSource 加入指定的容器中。Initializes a new instance of the BindingSource class and adds the BindingSource to the specified container.

BindingSource(Object, String)

使用指定的資料來源和資料成員,初始化 BindingSource 類別的新執行個體。Initializes a new instance of the BindingSource class with the specified data source and data member.

屬性

AllowEdit

取得值,指出基礎清單中的項目是否可以編輯。Gets a value indicating whether items in the underlying list can be edited.

AllowNew

取得或設定值,指出 AddNew() 方法是否可以用來將項目加入清單中。Gets or sets a value indicating whether the AddNew() method can be used to add items to the list.

AllowRemove

取得值,指出是否可以從基礎清單中移除項目。Gets a value indicating whether items can be removed from the underlying list.

CanRaiseEvents

取得值,指出元件是否能引發事件。Gets a value indicating whether the component can raise an event.

(繼承來源 Component)
Container

取得包含 IContainerComponentGets the IContainer that contains the Component.

(繼承來源 Component)
Count

將目前的 Filter 值納入考慮,取得基本清單中的項目總數。Gets the total number of items in the underlying list, taking the current Filter value into consideration.

CurrencyManager

取得與這個 BindingSource 關聯的 Currency 管理員。Gets the currency manager associated with this BindingSource.

Current

取得清單中的目前項目。Gets the current item in the list.

DataMember

取得或設定此連接器目前繫結至的資料來源中的特定清單。Gets or sets the specific list in the data source to which the connector currently binds to.

DataSource

取得或設定此連結器所繫結至的資料來源。Gets or sets the data source that the connector binds to.

DesignMode

取得值,指出 Component 目前是否處於設計模式。Gets a value that indicates whether the Component is currently in design mode.

(繼承來源 Component)
Events

取得附加在這個 Component 上的事件處理常式清單。Gets the list of event handlers that are attached to this Component.

(繼承來源 Component)
Filter

取得或設定用來篩選檢視的資料列的運算式。Gets or sets the expression used to filter which rows are viewed.

IsBindingSuspended

取得值,指出清單繫結是否已暫止。Gets a value indicating whether the list binding is suspended.

IsFixedSize

取得值,指出基礎清單是否有固定的大小。Gets a value indicating whether the underlying list has a fixed size.

IsReadOnly

取得值,指出基礎清單是否為唯讀。Gets a value indicating whether the underlying list is read-only.

IsSorted

取得值,指出基礎清單中的項目是否已排序。Gets a value indicating whether the items in the underlying list are sorted.

IsSynchronized

取得值,表示是否同步化存取集合 (執行緒安全)。Gets a value indicating whether access to the collection is synchronized (thread safe).

Item[Int32]

取得或設定指定索引中的清單項目。Gets or sets the list element at the specified index.

List

取得連接器要繫結至其中的清單。Gets the list that the connector is bound to.

Position

取得或設定基礎清單中目前項目的索引。Gets or sets the index of the current item in the underlying list.

RaiseListChangedEvents

取得或設定值,指出是否應該引發 ListChanged 事件。Gets or sets a value indicating whether ListChanged events should be raised.

Site

取得或設定 ComponentISiteGets or sets the ISite of the Component.

(繼承來源 Component)
Sort

取得或設定用來排序的資料行名稱,以及用來檢視資料來源中資料列的排序次序。Gets or sets the column names used for sorting, and the sort order for viewing the rows in the data source.

SortDescriptions

取得套用至資料來源的排序描述集合。Gets the collection of sort descriptions applied to the data source.

SortDirection

取得清單中項目排序的方向。Gets the direction the items in the list are sorted.

SortProperty

取得已經用來為清單排序的 PropertyDescriptorGets the PropertyDescriptor that is being used for sorting the list.

SupportsAdvancedSorting

取得值,指出資料來源是否支援多欄排序。Gets a value indicating whether the data source supports multi-column sorting.

SupportsChangeNotification

取得值,指出資料來源是否支援變更告知。Gets a value indicating whether the data source supports change notification.

SupportsFiltering

取得值,指出資料來源是否支援篩選。Gets a value indicating whether the data source supports filtering.

SupportsSearching

取得值,指出資料來源是否支援使用 Find(PropertyDescriptor, Object) 方法進行搜尋。Gets a value indicating whether the data source supports searching with the Find(PropertyDescriptor, Object) method.

SupportsSorting

取得值,指出資料來源是否支援排序。Gets a value indicating whether the data source supports sorting.

SyncRoot

取得可用來同步對基礎清單存取的物件。Gets an object that can be used to synchronize access to the underlying list.

方法

Add(Object)

將現有項目加入內部清單中。Adds an existing item to the internal list.

AddNew()

將新的項目加入基礎清單中。Adds a new item to the underlying list.

ApplySort(ListSortDescriptionCollection)

使用指定的排序描述,對資料來源排序。Sorts the data source with the specified sort descriptions.

ApplySort(PropertyDescriptor, ListSortDirection)

使用指定的屬性描述項和排序方向,對資料來源排序。Sorts the data source using the specified property descriptor and sort direction.

CancelEdit()

取消目前的編輯作業。Cancels the current edit operation.

Clear()

將所有項目從清單中移除。Removes all elements from the list.

Contains(Object)

判斷某個物件是否為清單中的項目。Determines whether an object is an item in the list.

CopyTo(Array, Int32)

從指定的索引值開始,將 List 的內容複製至指定的陣列。Copies the contents of the List to the specified array, starting at the specified index value.

CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(繼承來源 MarshalByRefObject)
Dispose()

釋放 Component 所使用的所有資源。Releases all resources used by the Component.

(繼承來源 Component)
Dispose(Boolean)

釋放 BindingSource 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the BindingSource and optionally releases the managed resources.

EndEdit()

將暫止的變更套用至基礎資料來源。Applies pending changes to the underlying data source.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
Find(PropertyDescriptor, Object)

搜尋具有指定屬性描述項的項目之索引。Searches for the index of the item that has the given property descriptor.

Find(String, Object)

傳回清單中具有指定屬性名稱和值的項目之索引。Returns the index of the item in the list with the specified property name and value.

GetEnumerator()

擷取 List 的列舉值。Retrieves an enumerator for the List.

GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetItemProperties(PropertyDescriptor[])

擷取 PropertyDescriptor 物件的陣列,表示資料來源清單型別的可繫結屬性。Retrieves an array of PropertyDescriptor objects representing the bindable properties of the data source list type.

GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
GetListName(PropertyDescriptor[])

取得為繫結提供資料的清單名稱。Gets the name of the list supplying data for the binding.

GetRelatedCurrencyManager(String)

取得指定之資料成員的相關 Currency 管理員。Gets the related currency manager for the specified data member.

GetService(Type)

傳回表示 Component 或其 Container 所提供之服務的物件。Returns an object that represents a service provided by the Component or by its Container.

(繼承來源 Component)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
IndexOf(Object)

搜尋指定的物件,並傳回整個清單中第一個相符項目的索引。Searches for the specified object and returns the index of the first occurrence within the entire list.

InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
Insert(Int32, Object)

將項目插入位於指定索引的清單中。Inserts an item into the list at the specified index.

MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(繼承來源 MarshalByRefObject)
MoveFirst()

移至清單中的第一個項目。Moves to the first item in the list.

MoveLast()

移至清單中的最後一個項目。Moves to the last item in the list.

MoveNext()

移至清單中的下一個項目。Moves to the next item in the list.

MovePrevious()

移至清單中的上一個項目。Moves to the previous item in the list.

OnAddingNew(AddingNewEventArgs)

引發 AddingNew 事件。Raises the AddingNew event.

OnBindingComplete(BindingCompleteEventArgs)

引發 BindingComplete 事件。Raises the BindingComplete event.

OnCurrentChanged(EventArgs)

引發 CurrentChanged 事件。Raises the CurrentChanged event.

OnCurrentItemChanged(EventArgs)

引發 CurrentItemChanged 事件。Raises the CurrentItemChanged event.

OnDataError(BindingManagerDataErrorEventArgs)

引發 DataError 事件。Raises the DataError event.

OnDataMemberChanged(EventArgs)

引發 DataMemberChanged 事件。Raises the DataMemberChanged event.

OnDataSourceChanged(EventArgs)

引發 DataSourceChanged 事件。Raises the DataSourceChanged event.

OnListChanged(ListChangedEventArgs)

引發 ListChanged 事件。Raises the ListChanged event.

OnPositionChanged(EventArgs)

引發 PositionChanged 事件。Raises the PositionChanged event.

Remove(Object)

從清單中移除指定的項目。Removes the specified item from the list.

RemoveAt(Int32)

移除清單中位於指定索引上的項目。Removes the item at the specified index in the list.

RemoveCurrent()

從清單中移除目前項目。Removes the current item from the list.

RemoveFilter()

移除與 BindingSource 有關的篩選條件。Removes the filter associated with the BindingSource.

RemoveSort()

移除與 BindingSource 有關的排序。Removes the sort associated with the BindingSource.

ResetAllowNew()

重新初始化 AllowNew 屬性。Reinitializes the AllowNew property.

ResetBindings(Boolean)

使得繫結至 BindingSource 的控制項重新讀取清單中的所有項目,並重新整理其顯示的值。Causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values.

ResetCurrentItem()

使得繫結至 BindingSource 的控制項重新讀取目前選取的項目,並重新整理其顯示的值。Causes a control bound to the BindingSource to reread the currently selected item and refresh its displayed value.

ResetItem(Int32)

使得繫結至 BindingSource 的控制項重新讀取指定索引上的項目,並重新整理其顯示的值。Causes a control bound to the BindingSource to reread the item at the specified index, and refresh its displayed value.

ResumeBinding()

繼續資料繫結。Resumes data binding.

SuspendBinding()

暫止資料繫結以防止變更更新繫結的資料來源。Suspends data binding to prevent changes from updating the bound data source.

ToString()

傳回任何包含 Component 名稱的 StringReturns a String containing the name of the Component, if any. 不應覆寫此方法。This method should not be overridden.

(繼承來源 Component)

事件

AddingNew

在項目加入基礎清單之前發生。Occurs before an item is added to the underlying list.

BindingComplete

發生於所有的用戶端都已繫結至這個 BindingSource 時。Occurs when all the clients have been bound to this BindingSource.

CurrentChanged

發生於目前繫結的項目變更時。Occurs when the currently bound item changes.

CurrentItemChanged

發生於 Current 屬性的屬性值已變更時。Occurs when a property value of the Current property has changed.

DataError

BindingSource 以無訊息模式處理與貨幣有關的例外狀況時發生。Occurs when a currency-related exception is silently handled by the BindingSource.

DataMemberChanged

發生於 DataMember 屬性值變更時。Occurs when the DataMember property value has changed.

DataSourceChanged

發生於 DataSource 屬性值變更時。Occurs when the DataSource property value has changed.

Disposed

當此元件由 Dispose() 方法的呼叫處置時發生。Occurs when the component is disposed by a call to the Dispose() method.

(繼承來源 Component)
ListChanged

發生於基礎清單有變更或清單中的項目有變更時。Occurs when the underlying list changes or an item in the list changes.

PositionChanged

發生於 Position 屬性的值已變更後。Occurs after the value of the Position property has changed.

明確介面實作

IBindingList.AddIndex(PropertyDescriptor)

PropertyDescriptor 加入用來搜尋的索引中。Adds the PropertyDescriptor to the indexes used for searching.

IBindingList.RemoveIndex(PropertyDescriptor)

從用來搜尋的索引中移除 PropertyDescriptorRemoves the PropertyDescriptor from the indexes used for searching.

ICancelAddNew.CancelNew(Int32)

從集合中捨棄暫止的新項目。Discards a pending new item from the collection.

ICancelAddNew.EndNew(Int32)

將暫止的新項目認可到集合中。Commits a pending new item to the collection.

ISupportInitialize.BeginInit()

BindingSource 表示正在啟動初始化。Signals the BindingSource that initialization is starting.

ISupportInitialize.EndInit()

BindingSource 表示初始化已完成。Signals the BindingSource that initialization is complete.

ISupportInitializeNotification.Initialized

發生於初始化 BindingSource 時。Occurs when the BindingSource is initialized.

ISupportInitializeNotification.IsInitialized

取得值,指出是否已初始化 BindingSourceGets a value indicating whether the BindingSource is initialized.

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

適用於

另請參閱