DataGridCell コンストラクタ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


DataGridCell を作成し、その新しいインスタンスを System.Windows.Forms.DataGrid コントロールの CurrentCell に設定する例を次に示します。
Private Sub SetCell() ' Set the focus to the cell specified by the DataGridCell. Dim dc As DataGridCell dc.RowNumber = 1 dc.ColumnNumber = 1 DataGrid1.CurrentCell = dc End Sub
private void SetCell() { // Set the focus to the cell specified by the DataGridCell. DataGridCell dc = new DataGridCell(); dc.RowNumber = 1; dc.ColumnNumber = 1; dataGrid1.CurrentCell = dc; }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataGridCell プロパティ


関連項目
DataGridCell 構造体System.Windows.Forms 名前空間
DataGrid.CurrentCell プロパティ
DataColumn
DataGrid クラス
DataRow
ColumnNumber
RowNumber
DataGridCell メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 オーバーライドされます。 |
![]() | GetHashCode | オーバーライドされます。 Hashtable に追加できるハッシュ値を取得します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | オーバーライドされます。 セルの行番号と列番号を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

関連項目
DataGridCell 構造体System.Windows.Forms 名前空間
DataGrid.CurrentCell プロパティ
DataColumn
DataGrid クラス
DataRow
ColumnNumber
RowNumber
DataGridCell メンバ
DataGridCell データ型で公開されるメンバを以下の表に示します。



名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 オーバーライドされます。 |
![]() | GetHashCode | オーバーライドされます。 Hashtable に追加できるハッシュ値を取得します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | オーバーライドされます。 セルの行番号と列番号を取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

関連項目
DataGridCell 構造体System.Windows.Forms 名前空間
DataGrid.CurrentCell プロパティ
DataColumn
DataGrid クラス
DataRow
ColumnNumber
RowNumber
DataGridCell 構造体
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)


DataGridCell を System.Windows.Forms.DataGrid コントロールの CurrentCell プロパティと組み合わせて使用すると、任意のセルの値を取得または設定できます。System.Windows.Forms.DataGrid コントロールの CurrentCell プロパティを DataGridCell に設定すると、DataGridCell で指定されているセルにフォーカスが移動します。

DataGridCell を System.Windows.Forms.DataGrid の CurrentCell に割り当て、選択したセルの列番号と行番号を返す例を次に示します。DataTable に格納されている値も、DataGridCell オブジェクトの RowNumber と 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
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]); }
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.get_CurrentCell(); Console.WriteLine(myCell.get_RowNumber()); Console.WriteLine(myCell.get_ColumnNumber()); // Prints the value of the cell through the DataTable. DataTable myTable; // Assumes the DataGrid is bound to a DataTable. myTable = (DataTable)(dataGrid1.get_DataSource()); Console.WriteLine(myTable.get_Rows(). get_Item(myCell.get_RowNumber()). get_Item(myCell.get_ColumnNumber())); } //PrintCellRowAndCol


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からDataGridCellを検索する場合は、下記のリンクをクリックしてください。

- DataGridCellのページへのリンク