A newer version of this page is available. Switch to the current version.

How to: Customize Tooltips for XtraGrid and CheckBox Using the ToolTipController

  • 2 minutes to read

This example demonstrates a way of using the tooltip controller to provide centralized control over the appearance of hints displayed by the Grid Control and a standard CheckBox. It assumes that the form already contains these controls.

To begin, place a ToolTipController component on the form. Modify the component's hint settings as shown in the image below.

toolTipCpntroller_setting_New

Then you need to bind the tooltip controller to the Grid Control. DevExpress controls and components can be bound to a tooltip controller via their ToolTipController property. This property is declared in the base classes for controls, container controls and container components. Once a tooltip controller has been assigned to a control, it controls the appearance and behavior of the control's hints. Hint settings for DevExpress controls whose ToolTipController properties are not initialized are controlled by the static ToolTipController.DefaultController property.

Use the XtraGrid's BaseControl.ToolTipController property to bind the tooltip controller:

toolTipCpntroller_assigning_New

The following image shows the hint being displayed for the grid's cell with a clipped text. The hint is displayed using the settings of the assigned ToolTipController.

toolTipCpntroller_result_New

A standard check box does not support the DevExpress.Utils.IToolTipControlClient interface, but it can also display hints controlled by a tooltip controller.

When a ToolTipController component is placed onto a form, a ToolTip property is automatically published by controls that do not support the DevExpress.Utils.IToolTipControlClient interface. Use this property to specify the hint's text for the check box as shown in the image below.

toolTipCpntroller_checkBox_New

The next image shows the hint activated for the check box.

toolTipCpntroller_chBoxResult_New

All of the above steps can be performed programmatically.


using DevExpress.Utils;

// Create and initialize the tooltip controller.
ToolTipController tooltipController = new ToolTipController();
tooltipController.ShowBeak = true;
// Bind the created tooltip controller to the Grid Control.
gridControl1.ToolTipController = tooltipController;
// Specify the hint for the check box.
tooltipController.SetToolTip(checkBox1, "Show cell hints");