DataRowChangeEventArgs(DataRow, DataRowAction) 建構函式

定義

初始化 DataRowChangeEventArgs 類別的新執行個體。

public:
 DataRowChangeEventArgs(System::Data::DataRow ^ row, System::Data::DataRowAction action);
public DataRowChangeEventArgs (System.Data.DataRow row, System.Data.DataRowAction action);
new System.Data.DataRowChangeEventArgs : System.Data.DataRow * System.Data.DataRowAction -> System.Data.DataRowChangeEventArgs
Public Sub New (row As DataRow, action As DataRowAction)

參數

row
DataRow

動作正在發生的所在 DataRow

action
DataRowAction

其中一個 DataRowAction 值。

範例

下列範例會新增 DataRowChangeEventHandler 和 程式,以在變更數據列時處理事件。


Private dataTable As DataTable

Private Sub [AddHandler]()
   dataTable = CType(DataGrid1.DataSource, DataTable)
   AddHandler dataTable.RowChanged, AddressOf Me.dataTable_Changed
End Sub

Private Sub dataTable_Changed _
(ByVal sender As System.Object, ByVal e As System.Data.DataRowChangeEventArgs)
   Console.WriteLine("Row Changed", e.Action, e.Row.Item(DataGrid1.CurrentCell.ColumnNumber))
End Sub

適用於

另請參閱