BindingList<T> 생성자

정의

BindingList<T> 클래스의 새 인스턴스를 초기화합니다.

오버로드

BindingList<T>()

기본값을 사용하여 BindingList<T> 클래스의 새 인스턴스를 초기화합니다.

BindingList<T>(IList<T>)

지정한 목록을 사용하여 BindingList<T> 클래스의 새 인스턴스를 초기화합니다.

BindingList<T>()

Source:
BindingList.cs
Source:
BindingList.cs
Source:
BindingList.cs

기본값을 사용하여 BindingList<T> 클래스의 새 인스턴스를 초기화합니다.

public:
 BindingList();
public BindingList ();
Public Sub New ()

예제

다음 코드 예제에서는 새 BindingList<T>를 생성하는 방법을 보여 줍니다. 전체 예제는 클래스 개요 항목을 참조 BindingList<T> 하세요.

    // Declare a new BindingListOfT with the Part business object.
    BindingList<Part> listOfParts; 
    private void InitializeListOfParts()
    {
        // Create the new BindingList of Part type.
        listOfParts = new BindingList<Part>();

        // Allow new parts to be added, but not removed once committed.        
        listOfParts.AllowNew = true;
        listOfParts.AllowRemove = false;

        // Raise ListChanged events when new parts are added.
        listOfParts.RaiseListChangedEvents = true;

        // Do not allow parts to be edited.
        listOfParts.AllowEdit = false;
        
        // Add a couple of parts to the list.
        listOfParts.Add(new Part("Widget", 1234));
        listOfParts.Add(new Part("Gadget", 5647));
    }
' Declare a new BindingListOfT with the Part business object.
Private WithEvents listOfParts As BindingList(Of Part)

Private Sub InitializeListOfParts()

    ' Create the new BindingList of Part type.
    listOfParts = New BindingList(Of Part)

    ' Allow new parts to be added, but not removed once committed.        
    listOfParts.AllowNew = True
    listOfParts.AllowRemove = False

    ' Raise ListChanged events when new parts are added.
    listOfParts.RaiseListChangedEvents = True

    ' Do not allow parts to be edited.
    listOfParts.AllowEdit = False

    ' Add a couple of parts to the list.
    listOfParts.Add(New Part("Widget", 1234))
    listOfParts.Add(New Part("Gadget", 5647))

End Sub

설명

다음 표에서는 BindingList<T> 클래스의 인스턴스에 대한 초기 속성 값을 보여 줍니다.

속성 초기 값
AllowEdit true
AllowNew true 목록 형식에 매개 변수가 없는 생성자가 있으면 이고, 그렇지 않으면 입니다 false.
AllowRemove true
RaiseListChangedEvents true

추가 정보

적용 대상

BindingList<T>(IList<T>)

Source:
BindingList.cs
Source:
BindingList.cs
Source:
BindingList.cs

지정한 목록을 사용하여 BindingList<T> 클래스의 새 인스턴스를 초기화합니다.

public:
 BindingList(System::Collections::Generic::IList<T> ^ list);
public BindingList (System.Collections.Generic.IList<T> list);
new System.ComponentModel.BindingList<'T> : System.Collections.Generic.IList<'T> -> System.ComponentModel.BindingList<'T>
Public Sub New (list As IList(Of T))

매개 변수

list
IList<T>

IList<T>에 포함될 항목의 BindingList<T>입니다.

설명

BindingList<T> 를 사용하여 에 의해 list뒷받침되는 을 만들 BindingList<T> 면 의 변경 내용 list 이 에 BindingList<T>반영됩니다.

다음 표에서는 BindingList<T> 클래스의 인스턴스에 대한 초기 속성 값을 보여 줍니다.

속성 초기 값
AllowEdit true
AllowNew true 목록 형식에 매개 변수가 없는 생성자가 있으면 이고, 그렇지 않으면 입니다 false.
AllowRemove true
RaiseListChangedEvents true

추가 정보

적용 대상