BindingList<T> 생성자

정의

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

오버로드

Name Description
BindingList<T>()

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

BindingList<T>(IList<T>)

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

BindingList<T>()

기본값을 사용하여 클래스의 새 인스턴스를 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;
void InitializeListOfParts()
{
    // Create the new BindingList of Part type.
    listOfParts = new BindingList<Part>
    {
        // Allow new parts to be added, but not removed once committed.        
        AllowNew = true,
        AllowRemove = false,

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

        // Do not allow parts to be edited.
        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>)

지정된 목록을 사용하여 클래스의 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

추가 정보

적용 대상