This is a migrated thread and some comments may be shown as answers.

ToolTip CloseButton position

3 Answers 122 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
DW Web Team Member
Top achievements
Rank 2
DW Web Team Member asked on 28 Jun 2010, 05:49 PM
Hi,

I have implemented a RAD tooltip manager to a label inside a grid with the HideEvent="ManualClose". The original width of tooltip is 30px (Width="30px") and is reset dynamically to fit actual information inside. However, the close button is still on it's original position. Is there any way to set up the Close button to be always on the top left corner of the tooltip?

Thank you

3 Answers, 1 is accepted

Sort by
0
DW Web Team Member
Top achievements
Rank 2
answered on 29 Jun 2010, 03:26 PM
Today I tried different approach and still have a problem with the Close button. I changed the HideEvent from "Default" to "ManualClose " on OnClientBeforeShow event:

 

        function OnClientBeforeShow(sender, args) {

 

 

            var current = Telerik.Web.UI.RadToolTip.getCurrent();

 

 

            if (current) {

 

                current.set_hideEvent(Telerik.Web.UI.ToolTipHideEvent.ManualClose);

 

            }

 

        }

After that, the tooltip stayed open but there were no Close button at all. Do I need to do something special in order the Close button to be visible?

Thanks again
0
Accepted
Svetlina Anati
Telerik team
answered on 01 Jul 2010, 12:44 PM
Hi DW,

The RadToolTip provides a method whcih returns the manual close button and you can use it to modify its position. I prepared for you the following sample code:


<script type="text/javascript">
    function OnClientShow(sender, args)
    {
        var btn = sender.getManualCloseButton();
        btn.style.left = "0px";
    }
</script>
<asp:HyperLink ID="target" runat="server" Text="Target control"></asp:HyperLink>
<telerik:RadToolTip ID="tip" runat="server" RelativeTo="Element" TargetControlID="target"
    Width="200px" Height="200px" HideEvent="ManualClose" OnClientShow="OnClientShow">
    The product was successfully added to the cart!
</telerik:RadToolTip>


Please, test my solution and let me know how it goes.

Sincerely yours,
Svetlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
DW Web Team Member
Top achievements
Rank 2
answered on 01 Jul 2010, 02:06 PM
Hello Svetlina,

The solution works!
Thank you very much!
Tags
ToolTip
Asked by
DW Web Team Member
Top achievements
Rank 2
Answers by
DW Web Team Member
Top achievements
Rank 2
Svetlina Anati
Telerik team
Share this question
or