RelativeTo property
Positioning a RadToolTip relative to the browser window (instead of to the mouse
or to an element) is very useful in some scenarios. In this manner different styles
can be built, for example an Outlook one, in which the tooltip is shown in the right
bottom area of the browser.
This can be easily done by setting the RadToolTip's
RelativeTo
property to
BrowserWindow and the
Position property
to the desired value.
A lot of configuration combinations are possible and it is important to know the
following rules by which the tooltip determines how and when to be shown:
-
The default scenario is when the RadToolTip has its TargetControlID set and also
has these settings: RelativeTo="Mouse" or MouseTrailing = "true". In this case its
position is calculated according to the mouse coordinates.
- The setting RelativeTo=BrowserWindow has a highest priority - the RadToolTip is
shown relative to the browser, not to a target control even if a TargetControlID
has been specified.
- If the TargetControlID
is not set and the ShowEvent is "FromCode" then the tooltip is positioned relative
to the browser window.
The OffsetX and OffsetY values are calculated using the browser corner (based on
the Position property setting).
-
If the TargetControlID is set and the ShowEvent is "FromCode" the tooltip's position
is calculated relative to the element.
-
If the tooltip has RelativeTo="Mouse" and TargetControl is set, and yet its showing
is invoked programmatically from code the tooltip is positioned relative to the
target element.
-
If the tooltip has RelativeTo="Element" and TargetControl is set, its position is
calculated according to the specified element.