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

ToolTipControllerEventArgsBase.SelectedObject Property

Gets or sets the element of the control for which the tooltip should be displayed.

Namespace: DevExpress.Utils

Assembly: DevExpress.Utils.v18.2.dll

Declaration

public object SelectedObject { get; set; }

Property Value

Type Description
Object

An object defining the element for which to display the tooltip.

Remarks

Some complex controls (such as GridControl and ButtonEdit) can display different tooltips for each control element. In this case, use the ToolTipControllerEventArgsBase.SelectedControl property to access the control and use the SelectedObject property to obtain the control’s element that invoked the tooltip.

The type of SelectedObject‘s value depends on the control’s type. For controls that do not implement the DevExpress.Utils.IToolTipControlClient interface (System.Windows.Forms.Button, for instance), SelectedObject is set to null (Nothing in Visual Basic).

If a tooltip is about to be displayed for the control (not its element) that implements the DevExpress.Utils.IToolTipControlClient interface (for instance, for any control derived from the BaseControl class), SelectedObjecthas the same value as the ToolTipControllerEventArgsBase.SelectedControl property.

If a tooltip should be displayed for an element of the control that implements the DevExpress.Utils.IToolTipControlClient interface, then SelectedObject refers to an object storing specific information. See the table below:

A tooltip is displayed for …

SelectedObject contains …

a button of a ButtonEdit control.

a string in the form “ButtonX” where X is the ordinal number of of the button in the editor’s button collection. For instance, when displaying a tooltip for the first button in the button collection, the SelectedObject will contain the “Button0” string.

a column header within GridControl.

a DevExpress.XtraGrid.GridToolTipInfo object.

The DevExpress.XtraGrid.GridToolTipInfo class provides the Grid and View properties which specify the grid control and its view, to which the column belongs. To get the column itself, use the Object property which refers to the required GridColumn instance.

an error icon in a cell in GridControl.

a DevExpress.XtraGrid.GridToolTipInfo object.

To get the grid control and the view which contains the cell with the error icon, use the Grid and View properties respectively.

The Object property refers to a DevExpress.XtraGrid.Views.Base.CellToolTipInfo object which allows you to identify the source cell. For this purpose, use the Column and RowHandle properties.

The CellObject property contains the “ErrorInfo” string.

an error icon for a specific row in the GridControl.

a DevExpress.XtraGrid.GridToolTipInfo object.

The Object property contains the string in the form “Indicator:X” where X is the row index. The Grid and View properties refer to the grid control and the view containing the specified row.

an error icon for a standalone editor derived from BaseEdit.

a String object containing the “ErrorInfo” string.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SelectedObject property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also