DataGridViewCellCollection.Insert(Int32, DataGridViewCell) 메서드

정의

지정된 인덱스의 컬렉션에 셀을 삽입합니다.

public:
 virtual void Insert(int index, System::Windows::Forms::DataGridViewCell ^ dataGridViewCell);
public virtual void Insert(int index, System.Windows.Forms.DataGridViewCell dataGridViewCell);
abstract member Insert : int * System.Windows.Forms.DataGridViewCell -> unit
override this.Insert : int * System.Windows.Forms.DataGridViewCell -> unit
Public Overridable Sub Insert (index As Integer, dataGridViewCell As DataGridViewCell)

매개 변수

index
Int32

배치할 인덱스(0부터 시작하는 인덱스) dataGridViewCell입니다.

dataGridViewCell
DataGridViewCell

삽입할 항목입니다 DataGridViewCell .

예외

이를 DataGridViewCellCollection 소유하는 행은 이미 컨트롤에 DataGridView 속합니다.

-또는-

dataGridViewCell 이미 에 속합니다 DataGridViewRow.

설명

컨트롤에 포함된 행 DataGridView 을 추가하기 전에 이 메서드를 사용하여 컬렉션을 변경합니다. 컨트롤에 행을 추가하면 포함된 셀 수가 항상 컨트롤의 열 수와 일치하므로 이 메서드는 더 이상 유용하지 않습니다.

적용 대상

추가 정보