CellCommentTextNeeded Event

Occurs when a cell's comment text is needed.

Syntax

Public Event CellCommentTextNeeded As CellCommentTextNeededEventHandler

Applies To

Grid Object

Parameters

The following parameters are available:

Parameter Description
CommentText 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 CellCommentTextNeeded event occurs only when the grid control DataSource property is set or its VirtualMode property is true. Handling the CellCommentTextNeeded event is useful when you want to display Comments determined by the current state or value of a cell.

When you handle the CellCommentTextNeeded event and specify comment text in the handler, a small red square that appears in the upper right of a cell unless the ShowCommentIndicator property is set to false or the cell is in edit mode. When the user moves the mouse pointer over the cell comment indicator, the cell comments are displayed in a similar manner as tooltips.

The CellCommentTextNeeded event also occurs whenever the value of the Cell.CommentText 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 CellCommentTextNeededEventArgs.CommentText property. This property is initialized with the value of the cell CommentText property, which the event value overrides.