DataGridViewCellCollection.Item[] 속성

정의

지정한 위치에 있는 항목을 가져오거나 설정합니다. C#에서 이 속성은 DataGridViewCellCollection 클래스의 인덱서입니다.

오버로드

Item[Int32]

지정된 인덱스 위치의 셀을 가져오거나 설정합니다. C#에서 이 속성은 DataGridViewCellCollection 클래스의 인덱서입니다.

Item[String]

지정된 이름의 열에 있는 셀을 가져오거나 설정합니다. C#에서 이 속성은 DataGridViewCellCollection 클래스의 인덱서입니다.

Item[Int32]

지정된 인덱스 위치의 셀을 가져오거나 설정합니다. C#에서 이 속성은 DataGridViewCellCollection 클래스의 인덱서입니다.

public:
 property System::Windows::Forms::DataGridViewCell ^ default[int] { System::Windows::Forms::DataGridViewCell ^ get(int index); void set(int index, System::Windows::Forms::DataGridViewCell ^ value); };
public System.Windows.Forms.DataGridViewCell this[int index] { get; set; }
member this.Item(int) : System.Windows.Forms.DataGridViewCell with get, set
Default Public Property Item(index As Integer) As DataGridViewCell

매개 변수

index
Int32

가져오거나 설정할 셀의 0부터 시작하는 인덱스입니다.

속성 값

지정된 인덱스에 저장된 DataGridViewCell입니다.

예외

이 속성을 설정할 때 지정된 값이 null입니다.

이 속성을 설정할 때 지정된 셀이 이미 DataGridView 컨트롤에 속해 있는 경우

또는

이 속성을 설정할 때 지정된 셀이 이미 DataGridViewRow에 속해 있는 경우

index 가 0보다 작습니다.

또는

index가 컬렉션의 셀 수보다 크거나 같은 경우

추가 정보

적용 대상

Item[String]

지정된 이름의 열에 있는 셀을 가져오거나 설정합니다. C#에서 이 속성은 DataGridViewCellCollection 클래스의 인덱서입니다.

public:
 property System::Windows::Forms::DataGridViewCell ^ default[System::String ^] { System::Windows::Forms::DataGridViewCell ^ get(System::String ^ columnName); void set(System::String ^ columnName, System::Windows::Forms::DataGridViewCell ^ value); };
public System.Windows.Forms.DataGridViewCell this[string columnName] { get; set; }
member this.Item(string) : System.Windows.Forms.DataGridViewCell with get, set
Default Public Property Item(columnName As String) As DataGridViewCell

매개 변수

columnName
String

셀을 가져오거나 설정할 열 이름입니다.

속성 값

지정된 이름의 열에 저장된 DataGridViewCell입니다.

예외

columnName과 일치하는 이름의 열이 컨트롤에 없는 경우

이 속성을 설정할 때 지정된 값이 null입니다.

이 속성을 설정할 때 지정된 셀이 이미 DataGridView 컨트롤에 속해 있는 경우

또는

이 속성을 설정할 때 지정된 셀이 이미 DataGridViewRow에 속해 있는 경우

추가 정보

적용 대상