PivotGridControl.FieldTooltipShowing Event

Occurs before a tooltip is invoked.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v21.1.dll

Declaration

public event PivotFieldTooltipShowingEventHandler FieldTooltipShowing

Event Data

The FieldTooltipShowing event's data class is PivotFieldTooltipShowingEventArgs. The following properties provide information specific to this event:

Property Description
HitInfo Gets information about the point where the tooltip should be invoked.
Point Gets the coordinates of the point where the tooltip should be invoked.
ShowTooltip Gets or sets whether to show the tooltip.
Text Gets or sets the tooltip text.

Remarks

The FieldTooltipShowing event occurs when a tooltip is about to be invoked, for example, when a user hovers with the mouse over a trimmed caption. This event allows you to cancel invoking the tooltip, or change the tooltip text and specify custom text instead.

The e.Point property gets the coordinates of the point where the tooltip is to be invoked. Use the e.HitInfo property to obtain more information about this point (for instance, which visual element is located there).

The e.Text property contains the default tooltip string. Change its value to specify custom text for the tooltip. Use the event parameter’s e.ShowTooltip property to specify whether to invoke the tooltip.

The following code sample adds the column field or row field value as a cell tooltip.

void pivotGridControl1_FieldTooltipShowing(object sender, DevExpress.XtraPivotGrid.PivotFieldTooltipShowingEventArgs e) {
    if (e.HitInfo.ValueInfo != null)
        e.Text = Convert.ToString(e.HitInfo.ValueInfo.Value);
}
See Also