CellErrorTextNeeded Event

Occurs when a cell's error text is needed.

Syntax

Public Event CellErrorTextNeeded As CellErrorTextNeededEventHandler

Applies To

Grid Object

Parameters

The following parameters are available:

Parameter Description
ErrorText Gets or sets the message that is displayed when the cell is selected.
Row Gets a value indicating the row index of the cell that the event occurs for.
Col Gets a value indicating the column index of the cell that the event occurs for.

Remarks

The CellErrorTextNeeded event occurs only when the grid control DataSource property is set or its VirtualMode property is true. Handling the CellErrorTextNeeded event is useful when you want to determine the error for a cell depending on its value or state.

When you handle the CellErrorTextNeeded event and specify error text in the handler, an error glyph appears in the cell unless the ShowCellErrors property is set to false or the cell is in edit mode. When the user moves the mouse pointer over the error glyph, the error text appears in a ToolTip.

The CellErrorTextNeeded event also occurs whenever the value of the Cell.ErrorText property is retrieved.

You can use the Row and Col property to determine the state or value of a cell, and use this information to change or modify the CellErrorTextNeededEventArgs.ErrorText property. This property is initialized with the value of the cell ErrorText property, which the event value overrides.