We are using a RadToolTip Control to display some items and we need to set the cursor postion to the bottom area (ie, Vertical Scroll bar shold be at the bottom of the control). We set the OffsetXand OffsetY for the scroll position, but it is not scrolling down.
5 Answers, 1 is accepted
I suggest to use the RadToolTips' OnClientShow event and to obtain a reference to its content DIV element there. After you do this, the task is actually stripped down to controlling the scrollbar of a standard DIV element.
I prepared for you sample code and I pasted it below:
<form id="form1" runat="server"> |
<asp:ScriptManager ID="ScriptManager1" runat="server" /> |
<div> |
<telerik:RadToolTip ID="RadToolTip1" runat="server" OnClientShow="OnClientShow" RelativeTo="Element" |
HideEvent="ManualClose" ContentScrolling="auto" Width="200" Height="300" Position="BottomRight" |
TargetControlID="HyperLink1"> |
----> Start content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
content here |
<br /> |
<-----End |
</telerik:RadToolTip> |
<asp:HyperLink ID="HyperLink1" runat="server">Target Control</asp:HyperLink> |
<script type="text/javascript"> |
function OnClientShow(sender, args) |
{ |
var contentElem = sender.get_contentElement(); |
contentElem.scrollTop = contentElem.scrollHeight; |
} |
</script> |
</div> |
</form> |
For your convenience I also attached my test page to the thread.
All the best,
Svetlina
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I tested the demo with RelativeTo=BrowserWindow instead of Element and everything is working as expected. Furthermore, the script manipulates only the content of the tooltip and it should not be influenced by the RelativeTo setting.
Would you please provide a more detailed explanations about what is exactly not working when you use the very same code along with Relative=BrowserWindow for the tooltip? In case different code reproduces the issue, please provide detailed instructions on how to replicate and observe the issue locally.
Kind regards,
Svetlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I am not sure what is the exact result you want to achieve. The RadToolTip has absolute position as default and default z-index of 8000 which could be changed by uisng its style attribute.
As to fine-tuning its position, you should use the following properties:
RelativeTo (default value - mouse):
http://demos.telerik.com/aspnet-ajax/tooltip/examples/relativeto/defaultcs.aspx
Position, OffsetX, OffsetY (you can test them below)
http://demos.telerik.com/aspnet-ajax/tooltip/examples/default/defaultcs.aspx
Please, examine teh provided demos as well as the other qsf demos for the tooltip and in case you need further assistance, provide a fully runnable sampel code and a screenshot of the actual result of this code along with the desired result clearly marked on it and I will do my best to help.
Best wishes,
Svetlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.