TileControl.CustomContextButtonToolTip Event

Allows you to dynamically customize item tooltips.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

[DXCategory("Events")]
public event TileContextButtonToolTipEventHandler CustomContextButtonToolTip
<DXCategory("Events")>
Public Event CustomContextButtonToolTip As TileContextButtonToolTipEventHandler

Event Data

The CustomContextButtonToolTip event's data class is DevExpress.XtraEditors.TileContextButtonToolTipEventArgs.

Remarks

The CustomContextButtonToolTip event is designed to modify a context button's tool-tip according to the value of the hovered point. Primarily, this applies to RatingContextButtons and TrackBarContextButtons. The following code sample illustrates how to assign a different tool-tip for each of the 5 rating button grades.


void tileControl1_CustomContextButtonToolTip(object sender, TileContextButtonToolTipEventArgs e) {
    if(e.ContextItem.GetType().ToString() == "RatingContextItem") {
        int rating = (int)e.Value;
        switch(rating) {
            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;
            default: e.Text = String.Empty; break;
        }
    }
}
See Also