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

2 tooltip

3 Answers 53 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Eva Stephen
Top achievements
Rank 1
Eva Stephen asked on 18 Dec 2009, 01:14 AM
Hi,

I need to apply two Showevent(OnClick,OnMouseOver) for one control.Here is my code.

 

 

<

 

telerik:RadToolTipManager runat="server" ID="RadToolTipOnClick" HideEvent="LeaveTargetAndToolTip"

 

 

ShowEvent="OnClick" OnClientShow="OnClientShow" Skin="Windows7" Width="100px" Height="20px"

 

 

ShowDelay="100" Sticky="true" AutoCloseDelay="5000" Position="MiddleRight" RelativeTo="Element" >

 

 

</telerik:RadToolTipManager>

 

 

 

 

 

 

 

<telerik:RadToolTipManager runat="server" ID="RadToolTipOnMouseOver" HideEvent="LeaveTargetAndToolTip"

 

 

ShowEvent="OnMouseOver" OnClientShow="OnClientShow" Skin="Windows7" Width="100px" Height="20px"

 

 

ShowDelay="100" Sticky="true" AutoCloseDelay="5000" Position="MiddleRight"RelativeTo="Element" >

 

 

</telerik:RadToolTipManager>

On Code behind

 

txtBox.ToolTip = fieldDescription.Description;

 

RadToolTipOnClick.TargetControls.Add(txtBox);

RadToolTipOnMouseOver.TargetControls.Add(txtBox);

But tooltip returns empty for Mouseover.Please refer attachment for more reference.
Please let me know what i'm missing here.

Thanks for all your support.
Eva


But for

3 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 18 Dec 2009, 03:00 PM
Hello Eva,

Would you please explain how exqactly you populate the text in the tooltip? If you do this by setting ToolTip/Title property of the target control, the behavior you report is expected because the first tooltip manager gets the text, creates a tooltip and displays it in it and removes the title form the target to prevent the browser tooltip to show as well (this will result in both a RadToolTipo and a standard browser tooltip which is not desired). That is why when the seciond manager should tooltipify the target, the title attribute is already removed and thus it creates and shows a blank tooltip.

If this is the case, what I can suggest is to set the desired text as a value and to set it in the OnAjaxUpdate event.


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.
0
Eva Stephen
Top achievements
Rank 1
answered on 18 Dec 2009, 05:07 PM
Hi Svetlina ,
Could you please provide an code sample for OnAjaxUpdate event. I saw this demo
http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx with radgrid.

But in my case i need to apply Showevent for all the textbox control in the page.
Thanks.
Eva
0
Svetlina Anati
Telerik team
answered on 19 Dec 2009, 12:47 PM
Hi Eva,

The ShowEvent is specified in teh markup declaration (or dynamically in code behind). However, it is not directly related to the OnAjaxUpdate event and should not be set there. The OnAjaxUpdate event is used only to populate the content of the tooltip. This being said, in ordre to add tooltips to your textbox, you should go through the following steps:

1) Add the textboxes to the TargetControls collection - you can do this on teh server or in the markup.
2) When you add each textbox, add a Value - it can be the string you want to show or a primary key value which should be used to extract information from a DB.
3) In the OnAjaxUpdate (you can have the same handler for both if the tooltips should have the same information) you put the content of the toooltip.

This approach is shown in all the LOD demos, including the one you have linked. The only difference between the demo you have examined and your setup is that you do not have an event as ItemDataBound where to attach tooltips but you can simply iterate through the textboxes or even easier - set them in the markup.



Greetings,
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.
Tags
ToolTip
Asked by
Eva Stephen
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Eva Stephen
Top achievements
Rank 1
Share this question
or