ControlBindingsCollection ControlBindingsCollection ControlBindingsCollection ControlBindingsCollection Class

정의

컨트롤에 대한 데이터 바인딩의 컬렉션을 나타냅니다.Represents the collection of data bindings for a control.

public ref class ControlBindingsCollection : System::Windows::Forms::BindingsCollection
[System.ComponentModel.TypeConverter("System.Windows.Forms.Design.ControlBindingsConverter, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.TypeConverter("System.Windows.Forms.Design.ControlBindingsConverter, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.TypeConverter("System.Windows.Forms.Design.ControlBindingsConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public class ControlBindingsCollection : System.Windows.Forms.BindingsCollection
type ControlBindingsCollection = class
    inherit BindingsCollection
Public Class ControlBindingsCollection
Inherits BindingsCollection
상속
특성

예제

다음 코드 예제에서는 Binding 개체를 ControlBindingsCollection 다섯 개의 컨트롤의: 4 TextBox 컨트롤 및 DateTimePicker 컨트롤입니다.The following code example adds Binding objects to a ControlBindingsCollection of five controls: four TextBox controls and a DateTimePicker control. ControlBindingsCollectionDataBindings 클래스의 Control 속성을 통해 액세스됩니다.The ControlBindingsCollection is accessed through the DataBindings property of the Control class.

protected:
   void BindControls()
   {
      /* Create two Binding objects for the first two TextBox 
         controls. The data-bound property for both controls 
         is the Text property. The data source is a DataSet 
         (ds). The data member is the navigation path: 
         TableName.ColumnName. */
      textBox1->DataBindings->Add( gcnew Binding(
         "Text",ds,"customers.custName" ) );
      textBox2->DataBindings->Add( gcnew Binding(
         "Text",ds,"customers.custID" ) );
      
      /* Bind the DateTimePicker control by adding a new Binding. 
         The data member of the DateTimePicker is a navigation path:
         TableName.RelationName.ColumnName. */
      DateTimePicker1->DataBindings->Add( gcnew Binding(
         "Value",ds,"customers.CustToOrders.OrderDate" ) );
      
      /* Create a new Binding using the DataSet and a 
         navigation path(TableName.RelationName.ColumnName).
         Add event delegates for the Parse and Format events to 
         the Binding object, and add the object to the third 
         TextBox control's BindingsCollection. The delegates 
         must be added before adding the Binding to the 
         collection; otherwise, no formatting occurs until 
         the Current object of the BindingManagerBase for 
         the data source changes. */
      Binding^ b = gcnew Binding(
         "Text",ds,"customers.custToOrders.OrderAmount" );
      b->Parse += gcnew ConvertEventHandler(
         this, &Form1::CurrencyStringToDecimal );
      b->Format += gcnew ConvertEventHandler(
         this, &Form1::DecimalToCurrencyString );
      textBox3->DataBindings->Add( b );
      
      /*Bind the fourth TextBox to the Value of the 
         DateTimePicker control. This demonstates how one control
         can be data-bound to another.*/
      textBox4->DataBindings->Add( "Text", DateTimePicker1, "Value" );
      
      // Get the BindingManagerBase for the textBox4 Binding.
      BindingManagerBase^ bmText = this->BindingContext[
         DateTimePicker1 ];
      
      /* Print the Type of the BindingManagerBase, which is 
         a PropertyManager because the data source
         returns only a single property value. */
      Console::WriteLine( bmText->GetType() );
      
      // Print the count of managed objects, which is one.
      Console::WriteLine( bmText->Count );
      
      // Get the BindingManagerBase for the Customers table. 
      bmCustomers = this->BindingContext[ds, "Customers"];
      
      /* Print the Type and count of the BindingManagerBase.
         Because the data source inherits from IBindingList,
         it is a RelatedCurrencyManager (a derived class of
         CurrencyManager). */
      Console::WriteLine( bmCustomers->GetType() );
      Console::WriteLine( bmCustomers->Count );
      
      /* Get the BindingManagerBase for the Orders of the current
         customer using a navigation path: TableName.RelationName. */
      bmOrders = this->BindingContext[ds, "customers.CustToOrders"];
   }
protected void BindControls()
{
   /* Create two Binding objects for the first two TextBox 
   controls. The data-bound property for both controls 
   is the Text property. The data source is a DataSet 
   (ds). The data member is the navigation path: 
   TableName.ColumnName. */
   textBox1.DataBindings.Add(new Binding
   ("Text", ds, "customers.custName"));
   textBox2.DataBindings.Add(new Binding
   ("Text", ds, "customers.custID"));
      
   /* Bind the DateTimePicker control by adding a new Binding. 
   The data member of the DateTimePicker is a navigation path:
   TableName.RelationName.ColumnName. */
   DateTimePicker1.DataBindings.Add(new 
   Binding("Value", ds, "customers.CustToOrders.OrderDate"));

   /* Create a new Binding using the DataSet and a 
   navigation path(TableName.RelationName.ColumnName).
   Add event delegates for the Parse and Format events to 
   the Binding object, and add the object to the third 
   TextBox control's BindingsCollection. The delegates 
   must be added before adding the Binding to the 
   collection; otherwise, no formatting occurs until 
   the Current object of the BindingManagerBase for 
   the data source changes. */
   Binding b = new Binding
   ("Text", ds, "customers.custToOrders.OrderAmount");
   b.Parse+=new ConvertEventHandler(CurrencyStringToDecimal);
   b.Format+=new ConvertEventHandler(DecimalToCurrencyString);
   textBox3.DataBindings.Add(b);

   /*Bind the fourth TextBox to the Value of the 
   DateTimePicker control. This demonstates how one control
   can be data-bound to another.*/
   textBox4.DataBindings.Add("Text", DateTimePicker1,"Value");

   // Get the BindingManagerBase for the textBox4 Binding.
   BindingManagerBase bmText = this.BindingContext
   [DateTimePicker1];

   /* Print the Type of the BindingManagerBase, which is 
   a PropertyManager because the data source
   returns only a single property value. */
   Console.WriteLine(bmText.GetType().ToString());

   // Print the count of managed objects, which is one.
   Console.WriteLine(bmText.Count);

   // Get the BindingManagerBase for the Customers table. 
   bmCustomers = this.BindingContext [ds, "Customers"];

   /* Print the Type and count of the BindingManagerBase.
   Because the data source inherits from IBindingList,
   it is a RelatedCurrencyManager (a derived class of
   CurrencyManager). */
   Console.WriteLine(bmCustomers.GetType().ToString());
   Console.WriteLine(bmCustomers.Count);
   
   /* Get the BindingManagerBase for the Orders of the current
   customer using a navigation path: TableName.RelationName. */ 
   bmOrders = this.BindingContext[ds, "customers.CustToOrders"];
}
Protected Sub BindControls()
    ' Create two Binding objects for the first two TextBox 
    ' controls. The data-bound property for both controls 
    ' is the Text property. The data source is a DataSet 
    ' (ds). The data member is the navigation path: 
    ' TableName.ColumnName. 
    textBox1.DataBindings.Add _
       (New Binding("Text", ds, "customers.custName"))
    textBox2.DataBindings.Add _
       (New Binding("Text", ds, "customers.custID"))
    
    ' Bind the DateTimePicker control by adding a new Binding. 
    ' The data member of the DateTimePicker is a navigation path:
    ' TableName.RelationName.ColumnName. 
    DateTimePicker1.DataBindings.Add _
       (New Binding("Value", ds, "customers.CustToOrders.OrderDate"))
    
    ' Create a new Binding using the DataSet and a 
    ' navigation path(TableName.RelationName.ColumnName).
    ' Add event delegates for the Parse and Format events to 
    ' the Binding object, and add the object to the third 
    ' TextBox control's BindingsCollection. The delegates 
    ' must be added before adding the Binding to the 
    ' collection; otherwise, no formatting occurs until 
    ' the Current object of the BindingManagerBase for 
    ' the data source changes. 
    Dim b As New Binding("Text", ds, "customers.custToOrders.OrderAmount")
    AddHandler b.Parse, AddressOf CurrencyStringToDecimal
    AddHandler b.Format, AddressOf DecimalToCurrencyString
    textBox3.DataBindings.Add(b)
    
    ' Bind the fourth TextBox to the Value of the 
    ' DateTimePicker control. This demonstates how one control
    ' can be data-bound to another.
    textBox4.DataBindings.Add("Text", DateTimePicker1, "Value")
    
    ' Get the BindingManagerBase for the textBox4 Binding.
    Dim bmText As BindingManagerBase = Me.BindingContext(DateTimePicker1)
    
    ' Print the Type of the BindingManagerBase, which is 
    ' a PropertyManager because the data source
    ' returns only a single property value. 
    Console.WriteLine(bmText.GetType().ToString())
    
    ' Print the count of managed objects, which is one.
    Console.WriteLine(bmText.Count)
    
    ' Get the BindingManagerBase for the Customers table. 
    bmCustomers = Me.BindingContext(ds, "Customers")
    
    ' Print the Type and count of the BindingManagerBase.
    ' Because the data source inherits from IBindingList,
    ' it is a RelatedCurrencyManager (a derived class of
    ' CurrencyManager). 
    Console.WriteLine(bmCustomers.GetType().ToString())
    Console.WriteLine(bmCustomers.Count)
    
    ' Get the BindingManagerBase for the Orders of the current
    ' customer using a navigation path: TableName.RelationName. 
    bmOrders = Me.BindingContext(ds, "customers.CustToOrders")
End Sub    

설명

단순 데이터 바인딩을 추가 하 여 이루어집니다 Binding 개체는 ControlBindingsCollection합니다.Simple data binding is accomplished by adding Binding objects to a ControlBindingsCollection. 상속 되는 모든 개체를 Control 클래스에 액세스할 수 합니다 ControlBindingsCollection 를 통해를 DataBindings 속성입니다.Any object that inherits from the Control class can access the ControlBindingsCollection through the DataBindings property. Windows의 목록을 데이터 바인딩을 지 원하는 컨트롤에 대 한 참조를 Binding 클래스입니다.For a list of Windows controls that support data binding, see the Binding class.

합니다 ControlBindingsCollection 와 같은 표준 컬렉션 메서드를 포함 AddClear, 및 Remove합니다.The ControlBindingsCollection contains standard collection methods such as Add, Clear, and Remove.

에 컨트롤을 가져오려면 합니다 ControlBindingsCollection 속한를 사용 하 여는 Control 속성입니다.To get the control that the ControlBindingsCollection belongs to, use the Control property.

생성자

ControlBindingsCollection(IBindableComponent) ControlBindingsCollection(IBindableComponent) ControlBindingsCollection(IBindableComponent) ControlBindingsCollection(IBindableComponent)

지정된 바인딩 가능한 컨트롤을 사용하여 ControlBindingsCollection 클래스의 새 인스턴스를 초기화합니다.Initializes a new instance of the ControlBindingsCollection class with the specified bindable control.

속성

BindableComponent BindableComponent BindableComponent BindableComponent

바인딩 컬렉션이 속한 IBindableComponent를 가져옵니다.Gets the IBindableComponent the binding collection belongs to.

Control Control Control Control

컬렉션이 속한 컨트롤을 가져옵니다.Gets the control that the collection belongs to.

Count Count Count Count

컬렉션의 전체 바인딩 수를 가져옵니다.Gets the total number of bindings in the collection.

(Inherited from BindingsCollection)
DefaultDataSourceUpdateMode DefaultDataSourceUpdateMode DefaultDataSourceUpdateMode DefaultDataSourceUpdateMode

컬렉션의 Binding에 대한 기본 DataSourceUpdateMode를 가져오거나 설정합니다.Gets or sets the default DataSourceUpdateMode for a Binding in the collection.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

컬렉션이 읽기 전용인지를 나타내는 값을 가져옵니다.Gets a value indicating whether the collection is read-only.

(Inherited from BaseCollection)
IsSynchronized IsSynchronized IsSynchronized IsSynchronized

ICollection에 대한 액세스가 동기화되는지 여부를 나타내는 값을 가져옵니다.Gets a value indicating whether access to the ICollection is synchronized.

(Inherited from BaseCollection)
Item[Int32] Item[Int32] Item[Int32] Item[Int32]

지정된 인덱스의 Binding를 가져옵니다.Gets the Binding at the specified index.

(Inherited from BindingsCollection)
Item[String] Item[String] Item[String] Item[String]

컨트롤의 속성 이름으로 지정된 Binding을 가져옵니다.Gets the Binding specified by the control's property name.

List List List List

컬렉션의 바인딩을 개체로 가져옵니다.Gets the bindings in the collection as an object.

(Inherited from BindingsCollection)
SyncRoot SyncRoot SyncRoot SyncRoot

BaseCollection에 대한 액세스를 동기화하는 데 사용할 수 있는 개체를 가져옵니다.Gets an object that can be used to synchronize access to the BaseCollection.

(Inherited from BaseCollection)

메서드

Add(Binding) Add(Binding) Add(Binding) Add(Binding)

지정된 Binding를 컬렉션에 추가합니다.Adds the specified Binding to the collection.

Add(String, Object, String) Add(String, Object, String) Add(String, Object, String) Add(String, Object, String)

지정된 컨트롤 속성 이름, 데이터 소스 및 데이터 멤버를 사용하여 Binding을 만든 다음 컬렉션에 추가합니다.Creates a Binding using the specified control property name, data source, and data member, and adds it to the collection.

Add(String, Object, String, Boolean) Add(String, Object, String, Boolean) Add(String, Object, String, Boolean) Add(String, Object, String, Boolean)

지정된 컨트롤 속성 이름, 데이터 소스, 데이터 멤버, 형식을 지정할 수 있는지 여부에 대한 정보 등을 사용하여 바인딩을 만든 다음 컬렉션에 바인딩을 추가합니다.Creates a binding with the specified control property name, data source, data member, and information about whether formatting is enabled, and adds the binding to the collection.

Add(String, Object, String, Boolean, DataSourceUpdateMode) Add(String, Object, String, Boolean, DataSourceUpdateMode) Add(String, Object, String, Boolean, DataSourceUpdateMode) Add(String, Object, String, Boolean, DataSourceUpdateMode)

지정된 컨트롤 속성을 지정된 데이터 소스의 지정된 데이터 멤버에 바인딩하는 바인딩을 만들고, 선택적으로 형식 지정을 활성화하고, 지정된 업데이트 설정을 기반으로 데이터 소스에 값을 전파하고, 바인딩을 컬렉션에 추가합니다.Creates a binding that binds the specified control property to the specified data member of the specified data source, optionally enabling formatting, propagating values to the data source based on the specified update setting, and adding the binding to the collection.

Add(String, Object, String, Boolean, DataSourceUpdateMode, Object) Add(String, Object, String, Boolean, DataSourceUpdateMode, Object) Add(String, Object, String, Boolean, DataSourceUpdateMode, Object) Add(String, Object, String, Boolean, DataSourceUpdateMode, Object)

지정된 컨트롤 속성을 지정된 데이터 소스의 지정된 데이터 멤버에 바인딩하는 바인딩을 만들고, 선택적으로 형식 지정을 활성화하고, 지정된 업데이트 설정을 기반으로 데이터 소스에 값을 전파하고, 데이터 소스에서 DBNull이 반환되면 해당 속성을 지정된 값으로 설정하고, 바인딩을 컬렉션에 추가합니다.Creates a binding that binds the specified control property to the specified data member of the specified data source, optionally enabling formatting, propagating values to the data source based on the specified update setting, setting the property to the specified value when DBNull is returned from the data source, and adding the binding to the collection.

Add(String, Object, String, Boolean, DataSourceUpdateMode, Object, String) Add(String, Object, String, Boolean, DataSourceUpdateMode, Object, String) Add(String, Object, String, Boolean, DataSourceUpdateMode, Object, String) Add(String, Object, String, Boolean, DataSourceUpdateMode, Object, String)

지정된 컨트롤 속성을 지정된 데이터 소스의 지정된 데이터 멤버에 바인딩하는 바인딩을 만들고, 선택적으로 지정된 형식 문자열을 사용하여 형식 지정을 활성화하고, 지정된 업데이트 설정을 기반으로 데이터 소스에 값을 전파하고, 데이터 소스에서 DBNull이 반환되면 해당 속성을 지정된 값으로 설정하고, 바인딩을 컬렉션에 추가합니다.Creates a binding that binds the specified control property to the specified data member of the specified data source, optionally enabling formatting with the specified format string, propagating values to the data source based on the specified update setting, setting the property to the specified value when DBNull is returned from the data source, and adding the binding to the collection.

Add(String, Object, String, Boolean, DataSourceUpdateMode, Object, String, IFormatProvider) Add(String, Object, String, Boolean, DataSourceUpdateMode, Object, String, IFormatProvider) Add(String, Object, String, Boolean, DataSourceUpdateMode, Object, String, IFormatProvider) Add(String, Object, String, Boolean, DataSourceUpdateMode, Object, String, IFormatProvider)

지정된 컨트롤 속성을 지정된 데이터 소스의 지정된 데이터 멤버에 바인딩하는 바인딩을 만들고, 선택적으로 지정된 형식 문자열을 사용하여 형식 지정을 활성화하고, 지정된 업데이트 설정을 기반으로 데이터 소스에 값을 전파하고, 데이터 소스에서 DBNull이 반환되면 해당 속성을 지정된 값으로 설정하고, 지정된 형식 공급자를 설정하고, 바인딩을 컬렉션에 추가합니다.Creates a binding that binds the specified control property to the specified data member of the specified data source, optionally enabling formatting with the specified format string, propagating values to the data source based on the specified update setting, setting the property to the specified value when DBNull is returned from the data source, setting the specified format provider, and adding the binding to the collection.

AddCore(Binding) AddCore(Binding) AddCore(Binding) AddCore(Binding)

컬렉션에 바인딩을 추가합니다.Adds a binding to the collection.

Clear() Clear() Clear() Clear()

모든 바인딩의 컬렉션을 지웁니다.Clears the collection of any bindings.

ClearCore() ClearCore() ClearCore() ClearCore()

컬렉션의 바인딩을 지웁니다.Clears the bindings in the collection.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

현재 1차원 Array의 모든 요소를 지정된 대상 Array 인덱스부터 시작하여 지정된 1차원 Array에 복사합니다.Copies all the elements of the current one-dimensional Array to the specified one-dimensional Array starting at the specified destination Array index.

(Inherited from BaseCollection)
CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

원격 개체와 통신하는 데 사용되는 프록시 생성에 필요한 모든 관련 정보가 들어 있는 개체를 만듭니다.Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(Inherited from MarshalByRefObject)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

컬렉션의 멤버 전체를 반복하도록 허용하는 개체를 가져옵니다.Gets the object that enables iterating through the members of the collection.

(Inherited from BaseCollection)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

기본 해시 함수로 작동합니다.Serves as the default hash function.

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

이 인스턴스의 수명 정책을 제어하는 현재의 수명 서비스 개체를 검색합니다.Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
GetType() GetType() GetType() GetType()

현재 인스턴스의 Type을 가져옵니다.Gets the Type of the current instance.

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

이 인스턴스의 수명 정책을 제어하는 수명 서비스 개체를 가져옵니다.Obtains a lifetime service object to control the lifetime policy for this instance.

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.Creates a shallow copy of the current Object.

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

현재 MarshalByRefObject 개체의 단순 복사본을 만듭니다.Creates a shallow copy of the current MarshalByRefObject object.

(Inherited from MarshalByRefObject)
OnCollectionChanged(CollectionChangeEventArgs) OnCollectionChanged(CollectionChangeEventArgs) OnCollectionChanged(CollectionChangeEventArgs) OnCollectionChanged(CollectionChangeEventArgs)

CollectionChanged 이벤트를 발생시킵니다.Raises the CollectionChanged event.

(Inherited from BindingsCollection)
OnCollectionChanging(CollectionChangeEventArgs) OnCollectionChanging(CollectionChangeEventArgs) OnCollectionChanging(CollectionChangeEventArgs) OnCollectionChanging(CollectionChangeEventArgs)

CollectionChanging 이벤트를 발생시킵니다.Raises the CollectionChanging event.

(Inherited from BindingsCollection)
Remove(Binding) Remove(Binding) Remove(Binding) Remove(Binding)

컬렉션에서 지정된 Binding을 삭제합니다.Deletes the specified Binding from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

지정한 인덱스의 Binding을 삭제합니다.Deletes the Binding at the specified index.

RemoveCore(Binding) RemoveCore(Binding) RemoveCore(Binding) RemoveCore(Binding)

컬렉션에서 지정된 바인딩을 제거합니다.Removes the specified binding from the collection.

ShouldSerializeMyAll() ShouldSerializeMyAll() ShouldSerializeMyAll() ShouldSerializeMyAll()

컬렉션이 serialize되어야 하는지를 나타내는 값을 가져옵니다.Gets a value that indicates whether the collection should be serialized.

(Inherited from BindingsCollection)
ToString() ToString() ToString() ToString()

현재 개체를 나타내는 문자열을 반환합니다.Returns a string that represents the current object.

(Inherited from Object)

이벤트

CollectionChanged CollectionChanged CollectionChanged CollectionChanged

컬렉션이 변경될 때 발생합니다.Occurs when the collection has changed.

(Inherited from BindingsCollection)
CollectionChanging CollectionChanging CollectionChanging CollectionChanging

컬렉션이 변경되려고 할 때 발생합니다.Occurs when the collection is about to change.

(Inherited from BindingsCollection)

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

요소를 캐스팅을 IEnumerable 를 지정 된 형식입니다.Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

요소를 필터링 하는 IEnumerable 지정된 된 형식에 기반 합니다.Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

쿼리를 병렬화할 수 있도록 합니다.Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

변환를 IEnumerableIQueryable합니다.Converts an IEnumerable to an IQueryable.

적용 대상