DataRow.CancelEdit メソッド
アセンブリ: System.Data (system.data.dll 内)




DataGrid コントロールの最後の行の 1 つの列の値を編集する例を次に示します。この例では、BeginEdit メソッドと EndEdit メソッドを使用して、列の値を編集し、その変更を行に対してコミットします。
Private Sub AcceptOrReject(ByVal row As DataRow) ' Use a function to validate the row's values. ' If the function returns true, end the edit; ' otherwise cancel it. If ValidateRow(row) Then row.EndEdit() Else row.CancelEdit() End If End Sub Private Function ValidateRow(ByVal row As DataRow) As Boolean Dim isValid As Boolean ' Insert code to validate the row values. ' Set the isValid variable. ValidateRow = isValid End Function
private void AcceptOrReject(DataRow row) { // Use a function to validate the row's values. // If the function returns true, end the edit; // otherwise cancel it. if(ValidateRow(row)) row.EndEdit(); else row.CancelEdit(); } private bool ValidateRow(DataRow thisRow) { bool isValid = true; // Insert code to validate the row values. // Set the isValid variable. return isValid; }

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に収録されているすべての辞書からDataRow.CancelEdit メソッドを検索する場合は、下記のリンクをクリックしてください。

- DataRow.CancelEdit メソッドのページへのリンク