Skip to main content
A newer version of this page is available. .

RatingControl.BeforeShowToolTip Event

Raises before the rating tooltip is shown and allows you to show your custom text.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

[DXCategory("Events")]
public event RatingToolTipEventHandler BeforeShowToolTip

Event Data

The BeforeShowToolTip event's data class is DevExpress.XtraEditors.Repository.RatingToolTipEventArgs.

Remarks

The BeforeShowToolTip event fires after an end-user hovered a rating item within this RatingControl, just before the tooltip is shown. By default, the tooltip text displays the hovered item’s value. Handle the BeforeShowToolTip event and specify the e.Text property to set the desired hint for the target rating item. To check which rating item is currently hovered, read the e.Value property.

Below is sample code that sets custom hints for the rating control with the RepositoryItemRatingControl.FillPrecision set to Full.

private void ratingControlSample_Properties_BeforeShowToolTip(object sender, Repository.RatingToolTipEventArgs e) {
    switch(Decimal.ToInt32(e.Value)) {
        case 1: e.Text = "Very bad";
            break;
        case 2: e.Text = "Bad";
            break;
        case 3: e.Text = "Average";
            break;
        case 4: e.Text = "Good";
            break;
        case 5: e.Text = "Excellent";
            break;
    }
}

The result is shown in the following animation.

RatingControl - Custom Tooltips

See Also