DataGridView::IsCurrentCellDirty Property

 

Gets a value indicating whether the current cell has uncommitted changes.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
[BrowsableAttribute(false)]
property bool IsCurrentCellDirty {
	bool get();
}

Property Value

Type: System::Boolean

true if the current cell has uncommitted changes; otherwise, false.

When the DataGridView is not bound to data, the cell edit is considered committed when the user moves to another cell.

If row headers are visible, a pencil glyph is present in the header for the row that contains a cell with uncommitted changes.

If IsCurrentCellDirty is true and the current cell hosts an editing control, you can retrieve it through the EditingControl property.

The following code example uses the IsCurrentCellDirty property to determine whether to commit a cell value and raise the CellValueChanged event from a handler for the CurrentCellDirtyStateChanged event. This code example is part of a larger example provided in How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: