DataGridViewRowCollection.IList.Add(Object) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
DataGridViewRow를 컬렉션에 추가합니다.
virtual int System.Collections.IList.Add(System::Object ^ value) = System::Collections::IList::Add;
int IList.Add (object value);
int IList.Add (object? value);
abstract member System.Collections.IList.Add : obj -> int
override this.System.Collections.IList.Add : obj -> int
Function Add (value As Object) As Integer Implements IList.Add
매개 변수
반환
새 DataGridViewRow의 인덱스입니다.
구현
예외
value
이(가) DataGridViewRow가 아닌 경우
연결된 DataGridView 컨트롤이 일시적으로 새 행이 추가되지 않도록 하는 다음 작업 중 하나를 수행합니다.
컨트롤의 모든 셀을 선택합니다.
선택 영역 지우기.
또는
이 메서드는 다음 DataGridView 이벤트 중 하나의 처리기에서 호출됩니다.
또는
DataSource 의 DataGridView 속성이 null
이 아닙니다.
또는
DataGridView 에 열이 없습니다.
또는
DataGridView 의 value
속성이 null
이 아닙니다.
또는
value
에 Selected 의 true
속성 값이 있습니다.
또는
이 작업에서는 고정되지 않은 행 뒤에 고정된 행을 추가합니다.
value
이(가) null
인 경우
value
에 컨트롤에 있는 열보다 많은 셀이 포함되어 있습니다.
설명
이 메서드는 명시적 인터페이스 멤버 구현 합니다. DataGridViewRowCollection 인스턴스가 IList 인터페이스로 캐스팅된 경우에만 사용할 수 있습니다.
이 메서드는 오버로드를 Add(DataGridViewRow) 호출하고 에 캐스팅한 value
후 을 DataGridViewRow전달합니다.
컨트롤의 행은 새 행이 추가될 때 자동으로 정렬되지 않습니다. 새 행을 올바른 위치로 정렬하려면 이벤트 처리기에서 메서드를 DataGridView.RowsAdded 호출 DataGridView.Sort 합니다. 사용자가 셀을 DataGridView.Sort 수정할 때 이벤트 처리기에서 CellValueChanged 메서드를 호출하여 행을 정렬할 수도 있습니다.
적용 대상
추가 정보
.NET