DataGridCell 構造体とは? わかりやすく解説

DataGridCell 構造体

グリッド内のセル識別します。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

public struct DataGridCell
public value class DataGridCell
public final class DataGridCell extends ValueType
JScript では、構造体使用できますが、新規に宣言することはできません。
解説解説

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

使用例使用例

DataGridCellSystem.Windows.Forms.DataGridCurrentCell割り当て選択したセル列番号と行番号返す例を次に示します。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
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridCell メンバ
System.Windows.Forms 名前空間
DataGrid.CurrentCell プロパティ
DataColumn
DataGrid クラス
DataRow
ColumnNumber
RowNumber



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DataGridCell 構造体」の関連用語

DataGridCell 構造体のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataGridCell 構造体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS