DataGridView.ShowRowErrors DataGridView.ShowRowErrors DataGridView.ShowRowErrors DataGridView.ShowRowErrors Property

Definition

Gets or sets a value indicating whether row headers will display error glyphs for each row that contains a data entry error.

public:
 property bool ShowRowErrors { bool get(); void set(bool value); };
public bool ShowRowErrors { get; set; }
member this.ShowRowErrors : bool with get, set
Public Property ShowRowErrors As Boolean

Property Value

true if the DataGridViewRow indicates there is an error; otherwise, false. The default is true.

Remarks

The ErrorText property indicates if there is an error in one of the cells in a row. If ErrorText is set to a value other than Empty, then an error glyph (ErrorProvider icon) is shown in the row header.

The default width of the row header includes enough room to display the error glyph, whether or not the glyph is displayed. If the row header size is adjusted so that there is not enough space to display the glyph completely, the glyph is not rendered.

Because row headers can display both text and glyphs, header content is displayed by priority, as follows:

  1. Text displayed in the row header cell.

  2. The editing glyph.

  3. The error glyph.

For example, if the row width is decreased, the error glyph disappears first, then the standard glyph, then text.

Advanced users can customize the error glyph by developing a custom DataGridViewRowHeaderCell or DataGridViewCell class.

Applies to

See also