Occurs when a row's error text is needed.
Public Event RowErrorTextNeeded As RowErrorTextNeededEventHandler
Grid Object
The following parameters are available:
Parameter | Description |
ErrorText | Gets or sets the error text for the row. |
Row | Gets the row that raised the RowErrorTextNeeded event. |
The RowErrorTextNeeded event occurs only when the DataSource property of the DataGridView control is set or its VirtualMode property is true. Handling the RowErrorTextNeeded event is useful when you want to determine the error for a row depending on its state and the values it contains.
When you handle the RowErrorTextNeeded event and specify error text in the handler, an error glyph appears in the row header unless the ShowRowErrors property is set to false. When the user moves the mouse pointer over the error glyph, the error text appears in a ToolTip.
The RowErrorTextNeeded event also occurs whenever the value of the Row.ErrorText property is retrieved.
You can use the RowErrorTextNeededEventArgs.Row property to determine the state of a row or the values it contains, and use this information to change or modify the RowErrorTextNeededEventArgs.ErrorText property. This property is initialized with the value of the row ErrorText property, which the event value overrides.