Assembly: System.Windows.Forms (in system.windows.forms.dll)
/** @event */ public void add_RowDirtyStateNeeded (QuestionEventHandler value) /** @event */ public void remove_RowDirtyStateNeeded (QuestionEventHandler value)
By default, this event sets the QuestionEventArgs.Response property to true if any cells in the current row have been modified. This causes the CancelRowEdit event to occur when the user reverts edits to a row. Users can revert edits to a row by pressing ESC twice when a cell is in edit mode or once outside of edit mode. This event can be used for customizing commit scope in virtual mode by setting the QuestionEventArgs.Response property to the correct value depending on the chosen commit scope.
For more information about handling events, see Consuming Events.
The following code example demonstrates how to handle this event to provide cell-level commit scope, meaning that the user can revert changes to the current cell only. In cell-level commit scope, the row is treated as having uncommitted changes only when the current cell has uncommitted changes, rather than when any cell in the row has uncommitted changes. This example is part of a larger example available in Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control.
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.