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

RadToolTipManager GridView Precedence

7 Answers 82 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Todd Stanistreet
Top achievements
Rank 1
Todd Stanistreet asked on 08 Jul 2010, 08:43 PM

I have a GridView which displays a variety of tooltips. Some are row level, some are cell specific, others are on template controls within a cell.

Without the  RadToolTipManager, this works perfectly fine. The standard browser tooltip handler always shows the correct tooltip.

When I add the RadToolTipManager, the row tooltips take precedence over everthing else.

<telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" AutoTooltipify="true" Sticky="true">
</telerik:RadToolTipManager>

So in the end all the other controls show tooltips correctly and all GridView row level tooltips show correctly but when a row has both cell, control and row tooltips together, the row (which is the less specific and lower precedence) tooltip always shows.

Is there a way to make this work the same way it would work normally? I want the look of the telerik tooltips and my skin but the functionality of the standard tooltip event handler for control precedence.

7 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 14 Jul 2010, 09:30 AM
Hello Todd Stanistreet,


I built up a test demo based on your explanations and also tested the provided HTML and I can confirm that I reproduced  the behavior you report. However, this is expected behavior since what happens is the way the things work. When you mouseover (or fire another event) the cell,  it raises its mouseover event which is bubbled and raises the mouseover event of the parent element which is the row. You can easily confirm this by using only standard HTML element and javascript without using RadControls at all. For example, look at the following sample code:


Copy Code

<table>

<tr title="tooltip 1" onmouseover="alert(1);" id="Grid1_ctl00__0">

<td>

Record1

</td>

<td>

Record2

</td>

<td title="tooltip cell" onmouseover="alert(2);">

Record3

</td>

<td>

Record4

</td>

</tr>

</table>


If you test it, you will see that when you hover the Record 3 TD element, the mouseover event of the parent TR is also fired due to the event bubbling and this is the cause for the problem. You can find more information about event bubbling on the net, e.g below:

http://www.quirksmode.org/js/events_order.html

What we suggest is to keep the things the way they are but in case you really need modifications of the functionality if you specify the exact result you want to achieve we can try to develop some workaround for you if this is possible. However, using such a workaround can cause a problem which in my opinion is not worthy to risk.



Best wishes,
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
Todd Stanistreet
Top achievements
Rank 1
answered on 14 Jul 2010, 03:23 PM

Hi Svetlina,

  Thanks for the reply. I haven't tried the javascript mouseover scenario but I'm sure you're correct in your assessment of event firing. However I'm not sure I agree with its relevance to the tooltip issue other than possibly being a technical hurtle. 

 

  Tooltip event handling is not the same as mouseover event handling, although underneath it works the same way, browsers seem to be blocking the event bubbling so far as my tests have shown. Tooltip event handling always results in displaying the tooltip relevant to the lowest child. The purpose of the RadToolTipManager is not to mimic mouseover event handling (this is just the mechanism used to make it work) but to mimic tooltip event handling and allow for fancier popups. In this respect it makes sense in all cases, not just mine, that the RadToolTipManager follows the same rules as normal HTML tooltips whenever possible.

  I understand that this may be technically more difficult because the RadToolTipManager uses a different event mechanism to support its features, but if this problem could be solved I wouldn't see it as a patch for my case but the correct solution for all cases. I commonly support layered tooltips within HTML controls for providing contextual help and additional information. This works great with HTML tooltips but since it isn't supported by the RadToolTipManager, I have all but eliminated it from my projects, which is really too bad since I lose a lot of other nice features it supports.

  I glanced at the link you provided (http://www.quirksmode.org/js/events_order.html). Basically there are 2 methods of event handling, bubbling and capturing. HTML Tooltips currently capture and RadToolTipManager currently bubbles. According to the document if Microsoft didn't exist bubbling wouldn't even have been supported, since most others favor capture. W3C supports both and handling capture within any event is as simple as supplying the correct event parameter or stopping propagation.

  If you agree and feel this is worth a change to the RadToolTipManager, great, I may get a chance in the future to re-integrate this feature back to my site but for now I have to eliminate the feature for my current release. I'm not really interested in some work around that isn't fundamentally part of the control and may not be supported in later releases but thanks for the offer.

thanks again,

Todd.

  

0
Svetlina Anati
Telerik team
answered on 19 Jul 2010, 01:43 PM
Hello Todd,

Thank you for your feedback, I understand your concern and I see your point. Actually, the tooltip works as you explain with the other events as click, etc. However, especially for the mouse over event we have decided not to cancel the bubbling because of many integration scenarios, e.g with RadComboBox, RadMenu, etc which need it.

What I can suggest is the following:

1) Use another event e.g click
2) If you want I can provide you with code which overrides the default behavior for mouse over as well. Note, however, that we do not recommend to override private functionality and you should extensively test your own project for possible problems which might occur as a result of this change. Note, also, that overriding private methods might result in problems in later upgrades if this code changes on our side. That is why we do not recommend this but if you decide to use this approach and to support possible problems this might cause, just let me know and I will provide you with the code in question.

On a side note, since you are the second or third person who asks about this, I forwarded it for future consideration we might introduce a property to control this but this depends on further discussions and feedback we receive.

I hope that my reply is helpful, let me know what you decide or whether I can be of help.



Best wishes,
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
Ahmad
Top achievements
Rank 1
answered on 12 Oct 2010, 04:01 PM
Dear Svetlina,

i have a small issue with Radtooltipmanager with GridView, i add RadToolTipManager control to the aspx page and i already have the script manager in the Master page, i add target all the controls to radtooltipmanager throught grid_databound method
the problem the Tooltip is appears for first row only, the other rows it dose not appear.

is there any suggestions?

BR
0
Svetlina Anati
Telerik team
answered on 15 Oct 2010, 09:21 AM
Hi Ahmad,

 The only reason for the behavior you describe could be that you have not correctly added the target controls. What I can suggest is to debug your code and see what is actually added to the collection. In case you are using AJAX, make sure that you update the RadToolTipManager as well along with the targets.

All the best,
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
Ahmad
Top achievements
Rank 1
answered on 15 Oct 2010, 12:04 PM
Dear Svetlina,

thanks for your reply, i did the same example on the internet exactly

http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx

as per my understrading from you i debug the code on the ITEM_DATABOUND its adding the target controls to the tooltipmanager correctly, however only first row show the tooltip and call OnAjaxUpdate method the others doing Postback without call OnAjaxUpdate method.

how i have to update tooltipmanager target controls?
0
Svetlina Anati
Telerik team
answered on 20 Oct 2010, 03:31 PM
Hi Ahmad,

 The demo you linked shows how to update the manager - if you examine the code more carefully you will see that it is added in the settings of RadAjaxManager.

On a side note, when you install RadControls, our online examples projects are automatically installed on your computer and you can not only examine their full source code, but also extend them further in order to meet your requirements.

You can open the demos from here:

Start\Programs\Telerik\RadControls for ASPNET AJAX\Open Sample WebSite In VisualStudio

The actual location on your hard disk is the following one:

C:\Program Files\Telerik\RadControls for ASPNET AJAX \Live Demos

I hope that this information is helpful.

All the best,
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
Tags
ToolTip
Asked by
Todd Stanistreet
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Todd Stanistreet
Top achievements
Rank 1
Ahmad
Top achievements
Rank 1
Share this question
or