DataGridViewRowEventArgsとは? わかりやすく解説

DataGridViewRowEventArgs クラス

メモ : このクラスは、.NET Framework version 2.0 で新しく追加されたものです。

DataGridView の行関連イベントのデータを提供します。

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

Public Class DataGridViewRowEventArgs
    Inherits EventArgs
Dim instance As DataGridViewRowEventArgs
public class DataGridViewRowEventArgs : EventArgs
public ref class DataGridViewRowEventArgs :
 public EventArgs
public class DataGridViewRowEventArgs extends
 EventArgs
public class DataGridViewRowEventArgs extends
 EventArgs
解説解説

DataGridViewRowEventArgs クラスでは、次の DataGridView イベント向けのデータが提供されます。

  • DefaultValuesNeeded

  • NewRowNeeded

  • RowDefaultCellStyleChanged

  • RowErrorTextChanged

  • RowHeaderCellChanged

  • RowHeightChanged

  • RowMinimumHeightChanged

  • RowUnshared

  • UserAddedRow

  • UserDeletedRow

  • RowContextMenuStripChanged

  • RowDividerHeightChanged

使用例使用例

この型の使用方法を次のコード例に示します。

Private Sub dataGridView1_DefaultValuesNeeded(ByVal
 sender As Object, _
    ByVal e As System.Windows.Forms.DataGridViewRowEventArgs)
 _
    Handles dataGridView1.DefaultValuesNeeded

    With e.Row
        .Cells("Region").Value = "WA"
        .Cells("City").Value = "Redmond"
        .Cells("PostalCode").Value = "98052-6399"
        .Cells("Region").Value = "NA"
        .Cells("Country").Value = "USA"
        .Cells("CustomerID").Value = NewCustomerId()
    End With

End Sub
private void dataGridView1_DefaultValuesNeeded(object
 sender,
    System.Windows.Forms.DataGridViewRowEventArgs e)
{
    e.Row.Cells["Region"].Value = "WA";
    e.Row.Cells["City"].Value = "Redmond";
    e.Row.Cells["PostalCode"].Value = "98052-6399";
    e.Row.Cells["Region"].Value = "NA";
    e.Row.Cells["Country"].Value = "USA";
    e.Row.Cells["CustomerID"].Value = NewCustomerId();
}
継承階層継承階層
System.Object
   System.EventArgs
    System.Windows.Forms.DataGridViewRowEventArgs
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridViewRowEventArgs メンバ
System.Windows.Forms 名前空間
DataGridView クラス
DataGridViewRow クラス
DataGridViewRowEventHandler

DataGridViewRowEventArgs コンストラクタ

メモ : このコンストラクタは、.NET Framework version 2.0 で新しく追加されたものです。

DataGridViewRowEventArgs クラスの新しいインスタンスを初期化します。

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

Public Sub New ( _
    dataGridViewRow As DataGridViewRow _
)
Dim dataGridViewRow As DataGridViewRow

Dim instance As New DataGridViewRowEventArgs(dataGridViewRow)
public DataGridViewRowEventArgs (
    DataGridViewRow dataGridViewRow
)
public:
DataGridViewRowEventArgs (
    DataGridViewRow^ dataGridViewRow
)
public DataGridViewRowEventArgs (
    DataGridViewRow dataGridViewRow
)
public function DataGridViewRowEventArgs (
    dataGridViewRow : DataGridViewRow
)

パラメータ

dataGridViewRow

イベント発生元の DataGridViewRow。

例外例外
例外の種類条件

ArgumentNullException

dataGridViewRow が null 参照 (Visual Basic では Nothing) です。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataGridViewRowEventArgs クラス
DataGridViewRowEventArgs メンバ
System.Windows.Forms 名前空間
DataGridView クラス
DataGridViewRow クラス
Row

DataGridViewRowEventArgs プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Row イベントに関連付けられている DataGridViewRow を取得します。
参照参照

関連項目

DataGridViewRowEventArgs クラス
System.Windows.Forms 名前空間
DataGridView クラス
DataGridViewRow クラス
DataGridViewRowEventHandler

DataGridViewRowEventArgs メソッド


DataGridViewRowEventArgs メンバ

DataGridView の行関連イベントのデータを提供します。

DataGridViewRowEventArgs データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド DataGridViewRowEventArgs DataGridViewRowEventArgs クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Row イベントに関連付けられている DataGridViewRow を取得します。
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

DataGridViewRowEventArgs クラス
System.Windows.Forms 名前空間
DataGridView クラス
DataGridViewRow クラス
DataGridViewRowEventHandler



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「DataGridViewRowEventArgs」の関連用語

DataGridViewRowEventArgsのお隣キーワード

   

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



DataGridViewRowEventArgsのページの著作権

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

©2026 GRAS Group, Inc.RSS