DataGridView.ShowRowErrors 属性

定义

获取或设置一个值,该值指示行标题是否为包含数据输入错误的每一行显示错误标志符号。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

属性值

如果true 指示有错误,则为 DataGridViewRow ;否则为 falsetrue if the DataGridViewRow indicates there is an error; otherwise, false. 默认值为 trueThe default is true.

注解

@No__t-0 属性指示行中某个单元格是否有错误。The ErrorText property indicates if there is an error in one of the cells in a row. 如果 ErrorText 设置为 Empty 以外的值,则行标题中将显示错误标志符号(ErrorProvider 图标)。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.

高级用户可以通过开发自定义的 @no__t 0 或 @no__t 类自定义错误标志符号。Advanced users can customize the error glyph by developing a custom DataGridViewRowHeaderCell or DataGridViewCell class.

适用于

另请参阅