DataRowView イベント
DataRowView クラス
アセンブリ: System.Data (system.data.dll 内)

Public Class DataRowView Implements ICustomTypeDescriptor, IEditableObject, IDataErrorInfo, INotifyPropertyChanged
public class DataRowView : ICustomTypeDescriptor, IEditableObject, IDataErrorInfo, INotifyPropertyChanged
public ref class DataRowView : ICustomTypeDescriptor, IEditableObject, IDataErrorInfo, INotifyPropertyChanged

データを DataGrid コントロールなどで表示する場合、1 行につき 1 つのバージョンだけを表示できます。表示されている行は DataRowView です。
DataRowView は、Default、Original、Current、および Proposed という 4 種類のバージョン状態のいずれか 1 つになります。
DataRow で BeginEdit を呼び出した後で編集した値は Proposed 値になります。CancelEdit または EndEdit のどちらかを呼び出すまでは、行には Original バージョンと Proposed バージョンが格納されています。CancelEdit を呼び出すと、提示されたバージョンが破棄され、値が Original に戻ります。EndEdit を呼び出すと、DataRowView には Proposed バージョンがなくなり、提示された値が現在の値になります。既定値は、既定値が定義されている列を含む行でだけ使用できます。

RowVersion プロパティを使用して、DataRowView 内の行の状態を確認する例を次に示します。
Private Sub DemonstrateRowVersion() Dim i As Integer ' Create a DataTable with one column. Dim table As New DataTable("Table") Dim column As New DataColumn("Column") table.Columns.Add(column) ' Add ten rows. Dim row As DataRow For i = 0 To 9 row = table.NewRow() row("Column") = "item " + i.ToString() table.Rows.Add(row) Next i table.AcceptChanges() ' Create a DataView with the table. Dim view As New DataView(table) ' Change one row's value: table.Rows(1)("Column") = "Hello" ' Add one row: row = table.NewRow() row("Column") = "World" table.Rows.Add(row) ' Set the RowStateFilter to display only added and modified rows. view.RowStateFilter = _ DataViewRowState.Added Or DataViewRowState.ModifiedCurrent ' Print those rows. Output includes "Hello" and "World". PrintView(view, "ModifiedCurrent and Added") ' Set filter to display only originals of modified rows. view.RowStateFilter = DataViewRowState.ModifiedOriginal PrintView(view, "ModifiedOriginal") ' Delete three rows. table.Rows(1).Delete() table.Rows(2).Delete() table.Rows(3).Delete() ' Set the RowStateFilter to display only deleted rows. view.RowStateFilter = DataViewRowState.Deleted PrintView(view, "Deleted") ' Set filter to display only current rows. view.RowStateFilter = DataViewRowState.CurrentRows PrintView(view, "Current") ' Set filter to display only unchanged rows. view.RowStateFilter = DataViewRowState.Unchanged PrintView(view, "Unchanged") ' Set filter to display only original rows. ' Current values of unmodified rows are also returned. view.RowStateFilter = DataViewRowState.OriginalRows PrintView(view, "OriginalRows") End Sub Private Sub PrintView(ByVal view As DataView, ByVal label As String) Console.WriteLine(ControlChars.Cr + label) Dim i As Integer For i = 0 To view.Count - 1 Console.WriteLine(view(i)("Column")) Console.WriteLine("DataRowView.RowVersion: {0}", _ view(i).RowVersion) Next i End Sub
private static void DemonstrateRowVersion() { // Create a DataTable with one column. DataTable table = new DataTable("Table"); DataColumn column = new DataColumn("Column"); table.Columns.Add(column); // Add ten rows. DataRow row; for (int i = 0; i < 10; i++) { row = table.NewRow(); row["Column"] = "item " + i; table.Rows.Add(row); } table.AcceptChanges(); // Create a DataView with the table. DataView view = new DataView(table); // Change one row's value: table.Rows[1]["Column"] = "Hello"; // Add one row: row = table.NewRow(); row["Column"] = "World"; table.Rows.Add(row); // Set the RowStateFilter to display only added // and modified rows. view.RowStateFilter = DataViewRowState.Added | DataViewRowState.ModifiedCurrent; // Print those rows. Output includes "Hello" and "World". PrintView(view, "ModifiedCurrent and Added"); // Set filter to display only originals of modified rows. view.RowStateFilter = DataViewRowState.ModifiedOriginal; PrintView(view, "ModifiedOriginal"); // Delete three rows. table.Rows[1].Delete(); table.Rows[2].Delete(); table.Rows[3].Delete(); // Set the RowStateFilter to display only deleted rows. view.RowStateFilter = DataViewRowState.Deleted; PrintView(view, "Deleted"); // Set filter to display only current rows. view.RowStateFilter = DataViewRowState.CurrentRows; PrintView(view, "Current"); // Set filter to display only unchanged rows. view.RowStateFilter = DataViewRowState.Unchanged; PrintView(view, "Unchanged"); // Set filter to display only original rows. // Current values of unmodified rows are also returned. view.RowStateFilter = DataViewRowState.OriginalRows; PrintView(view, "OriginalRows"); } private static void PrintView(DataView view, string label) { Console.WriteLine("\n" + label); for (int i = 0; i < view.Count; i++) { Console.WriteLine(view[i]["Column"]); Console.WriteLine("DataViewRow.RowVersion: {0}", view[i].RowVersion); } }

System.Data.DataRowView


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


DataRowView プロパティ
DataRowView メソッド

名前 | 説明 | |
---|---|---|
![]() | BeginEdit | 編集プロシージャを開始します。 |
![]() | CancelEdit | 編集プロシージャをキャンセルします。 |
![]() | CreateChildView | オーバーロードされます。 子 DataTable の DataView を返します。 |
![]() | Delete | 行を削除します。 |
![]() | EndEdit | 編集プロシージャを終了します。 |
![]() | Equals | オーバーロードされます。 オーバーライドされます。 現在の DataRowView が指定したオブジェクトと同一かどうかを示す値を取得します。 |
![]() | GetHashCode | オーバーライドされます。 DataRow オブジェクトのハッシュ コードを返します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

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

名前 | 説明 | |
---|---|---|
![]() | System.ComponentModel.ICustomTypeDescriptor.GetAttributes | このメンバの説明については、ICustomTypeDescriptor.GetAttributes のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetClassName | このメンバの説明については、ICustomTypeDescriptor.GetClassName のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetComponentName | このメンバの説明については、ICustomTypeDescriptor.GetComponentName のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetConverter | このメンバの説明については、ICustomTypeDescriptor.GetConverter のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetDefaultEvent | このメンバの説明については、ICustomTypeDescriptor.GetDefaultEvent のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetDefaultProperty | このメンバの説明については、ICustomTypeDescriptor.GetDefaultProperty のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetEditor | このメンバの説明については、ICustomTypeDescriptor.GetEditor のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetEvents | オーバーロードされます。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetProperties | オーバーロードされます。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetPropertyOwner | このメンバの説明については、ICustomTypeDescriptor.GetPropertyOwner のトピックを参照してください。 |

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


名前 | 説明 | |
---|---|---|
![]() | BeginEdit | 編集プロシージャを開始します。 |
![]() | CancelEdit | 編集プロシージャをキャンセルします。 |
![]() | CreateChildView | オーバーロードされます。 子 DataTable の DataView を返します。 |
![]() | Delete | 行を削除します。 |
![]() | EndEdit | 編集プロシージャを終了します。 |
![]() | Equals | オーバーロードされます。 オーバーライドされます。 現在の DataRowView が指定したオブジェクトと同一かどうかを示す値を取得します。 |
![]() | GetHashCode | オーバーライドされます。 DataRow オブジェクトのハッシュ コードを返します。 |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

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


名前 | 説明 | |
---|---|---|
![]() | System.ComponentModel.ICustomTypeDescriptor.GetAttributes | このメンバの説明については、ICustomTypeDescriptor.GetAttributes のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetClassName | このメンバの説明については、ICustomTypeDescriptor.GetClassName のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetComponentName | このメンバの説明については、ICustomTypeDescriptor.GetComponentName のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetConverter | このメンバの説明については、ICustomTypeDescriptor.GetConverter のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetDefaultEvent | このメンバの説明については、ICustomTypeDescriptor.GetDefaultEvent のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetDefaultProperty | このメンバの説明については、ICustomTypeDescriptor.GetDefaultProperty のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetEditor | このメンバの説明については、ICustomTypeDescriptor.GetEditor のトピックを参照してください。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetEvents | オーバーロードされます。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetProperties | オーバーロードされます。 |
![]() | System.ComponentModel.ICustomTypeDescriptor.GetPropertyOwner | このメンバの説明については、ICustomTypeDescriptor.GetPropertyOwner のトピックを参照してください。 |
![]() | System.ComponentModel.IDataErrorInfo.Item | このメンバの説明については、IDataErrorInfo.Item のトピックを参照してください。 |

- DataRowViewのページへのリンク