DataGridCell 구조체

정의

모눈의 셀을 식별합니다.

public value class DataGridCell
public struct DataGridCell
type DataGridCell = struct
Public Structure DataGridCell
상속
DataGridCell

예제

다음 예제에서는 합니다 DataGridCellCurrentCellSystem.Windows.Forms.DataGrid 선택된 된 셀의 열 및 행 수를 반환 합니다. 에 저장 된 값을 DataTable 를 사용 하 여 인쇄 되어 합니다 DataGridCell 개체의 RowNumberColumnNumber합니다.

void PrintCellRowAndCol()
{
   DataGridCell^ myCell;
   myCell = DataGrid1->CurrentCell;
   Console::WriteLine( myCell->RowNumber );
   Console::WriteLine( myCell->ColumnNumber );
   
   // Prints the value of the cell through the DataTable.
   DataTable^ myTable;
   
   // Assumes the DataGrid is bound to a DataTable.
   myTable = dynamic_cast<DataTable^>(DataGrid1->DataSource);
   Console::WriteLine( myTable->Rows[ myCell->RowNumber ][ myCell->ColumnNumber ] );
}
private void PrintCellRowAndCol()
{
   DataGridCell myCell;
   myCell = DataGrid1.CurrentCell;
   Console.WriteLine(myCell.RowNumber);
   Console.WriteLine(myCell.ColumnNumber);
   // Prints the value of the cell through the DataTable.
   DataTable myTable;
   // Assumes the DataGrid is bound to a DataTable.
   myTable = (DataTable) DataGrid1.DataSource;
   Console.WriteLine(myTable.Rows[myCell.RowNumber]
   [myCell.ColumnNumber]);
}
Private Sub PrintCellRowAndCol()
    Dim myCell As DataGridCell
    myCell = DataGrid1.CurrentCell
    Console.WriteLine(myCell.RowNumber)
    Console.WriteLine(myCell.ColumnNumber)
    ' Prints the value of the cell through the DataTable.
    Dim myTable As DataTable
    ' Assumes the DataGrid is bound to a DataTable.
    myTable = CType(DataGrid1.DataSource, DataTable)
    Console.WriteLine(myTable.Rows(myCell.RowNumber)(myCell.ColumnNumber))
 End Sub

설명

합니다 DataGridCell 와 함께에서 사용할 수는 System.Windows.Forms.DataGrid 컨트롤의 CurrentCell 속성을 셀의 값을 가져오거나 설정 합니다. 설정 된 System.Windows.Forms.DataGrid 컨트롤의 CurrentCell 속성을를 DataGridCell 포커스가 지정 되는 셀을 이동 하면는 DataGridCell합니다.

생성자

DataGridCell(Int32, Int32)

DataGridCell 클래스의 새 인스턴스를 초기화합니다.

속성

ColumnNumber

DataGrid 컨트롤의 열 번호를 가져오거나 설정합니다.

RowNumber

DataGrid 컨트롤의 행 번호를 가져오거나 설정합니다.

메서드

Equals(Object)

DataGridCell이 두 번째 DataGridCell과 동일한지 여부를 나타내는 값을 가져옵니다.

GetHashCode()

Hashtable에 추가할 수 있는 해시 값을 가져옵니다.

ToString()

셀의 행 번호 및 열 번호를 가져옵니다.

적용 대상

추가 정보