DefaultNewRowValue Property

DataGridViewCell.DefaultNewRowValue Property


Gets the default value for a cell in the row for new records.

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

abstract DefaultNewRowValue : Object with get
override DefaultNewRowValue : Object with get

Property Value

Type: System.Object

An Object representing the default value.

The DefaultNewRowValue property in the base class DataGridViewCell always returns null. However, this property can be overridden in derived cell classes to return other default values.

The value returned by this property is displayed if the cell is in the row for new records. This value can be overridden by a handler for the DataGridView.DefaultValuesNeeded event when focus enters the row for new records.

The following code example demonstrates how to override the DefaultNewRowValue property in a CalendarCell class that derives from DataGridViewTextBoxCell. This example is part of a larger code example provided in How to: Host Controls in Windows Forms DataGridView Cells.

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

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft