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

RadGrid tooltip via webservice

9 Answers 144 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Baal
Top achievements
Rank 1
Baal asked on 23 Apr 2010, 08:44 PM
I have a radgrid. A couple of columns require tooltip. I am using web service to load data into my tooltip instead of pre-loading them during grid load.

Here's my grid and radtooltip manager.
<telrik:RadGrid ID="rg" runat="server" ....> 
    <MasterTableview DataSourceId="odsProducts"
        <Columns> 
            <telerik:GridTemplateColumn HeaderText="Product"
                <ItemTemplate> 
                    <asp:HyperLink ID="hlProduct" runat="server" /> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
            <telerik:GridTemplateColumn HeaderText="Price"
                <ItemTemplate> 
                    <asp:HyperLink ID="hlPrice" runat="server" /> 
                </ItemTemplate> 
            </telerik:GridTemplateColumn> 
        </Columns> 
    </MasterTableView 
</telerik:RadGrid> 
 
<telerik:RadToolTipManager ID="rttManager" runat="server" Position="BottomCenter" RelativeTo="Element" Animation="Fade" /> 


On the codebehind I'm settng the tooltip manager info.
rttManager.WebServiceSettings.Path = "~/WebServices/AppWebService.asmx"
rttManager.WebServiceSettings.Method = "GetProductToolTips"
rttManager.HideEvent = ToolTipHideEvent.LeaveTargetAndToolTip; 


Now, I'm setting the tooltip info in the grid itemcreated method
rttManager.TargetControls.Add(hlProducts.ClientID, productId.ToString(), true); 


Here's my webservice method if you think it helps you:
[WebMethod] 
public string GetProductToolTips (object context) 
    IDictionary<stringobject> contextDictionary = (IDictionary<stringobject>)context; 
    string productId = ((string)contextDictionary["Value"]); 
     
    if (String.IsNullOrEmpty(productId)) 
        return String.Empty; 
    else 
        return RenderViewManager.RenderView("~/Products/UserControls/ProductToolTip.ascx"); 


So far so fine. The hlProduct element now shows tooltip. Now, I want the hlPrice element to show tooltip as well. Problem is I can't have another tooltipmanager in the page. I don't know if it is possible to create a new method for the new element.

Can somebody help me with it.

Thanks.

9 Answers, 1 is accepted

Sort by
0
Baal
Top achievements
Rank 1
answered on 27 Apr 2010, 03:29 PM
I tried adding multiple ToolTipManager in the same page and it is supported. Now I have two different managers pointing to two different webservice methods for each column.

My problem is now resolved. Moderators, you can close this thread.

Thanks.
0
Svetlina Anati
Telerik team
answered on 28 Apr 2010, 09:06 AM
Hello Baal,

We are glad to hear that you were able to resolve the problem. We can also confirm that there is no limitation of the number of RadToolTipManager controls on the same page and having more than one is a valid scenario. Furthermore, having more than one RadTooltipManagers on the page should not significantly influence the performance and the difference in the rendered HTML should not be significant as well.

This being said, we confirm that the solution you found is a reliable one and we recommend to stick to it.

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
Baal
Top achievements
Rank 1
answered on 21 Jul 2010, 11:39 PM
Followup to this question:

In my usercontrol, which is the content of the tooltip, I addad a RadChart. Now I get a error saying:
Error executing child request for handler 'System.Web.UI.Page'

This error comes from the RenderViewManager class at the following line.
HttpContext.Current.Server.Execute(pageHolder, output, false);

This error comes up only when I add RadChart to the usercontrol. Other controls like grids, comboboxes, images, etc in the usercontrol all work fine.
0
Yavor
Telerik team
answered on 28 Jul 2010, 09:20 AM
Hi Baal,

Based on the supplied information, it is hard to determine what is causing this exeption. It may be caused by the way the user control is loaded on the page, or an issue with the nesting in the tooltip. In any case, to properly address the issue, it will be best if you open a formal support ticket, and send us a small working project, demonstrating your setup, and showing the unwanted behavior/exception. We will debug it locally, and get back to you with more information on the matter.

Kind regards,
Yavor
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
Baal
Top achievements
Rank 1
answered on 28 Jul 2010, 04:51 PM
I am currenly using a RadWindow instead of Tooltip to display the chart. However, I believe tooltip would be a better fit to my project. I will create a small sample probably during the weekend and send it to you so you can look into it.

Thanks.
0
Rumen
Telerik team
answered on 02 Aug 2010, 03:48 PM
Hi Baal,

Were you able to isolate the problem in a sample reproduction problem? Once we receive it, we will do our best to help you.

Kind regards,
Rumen
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
Baal
Top achievements
Rank 1
answered on 10 Sep 2010, 04:56 PM
Rumen,

I've been busy too busy last month. RadWindow has been doing the job just fine for now. Still, I'll create a sample application and send it over to you once I have some time on my hand.

Thanks.
0
Svetlina Anati
Telerik team
answered on 13 Sep 2010, 10:59 AM
Hi Baal,

 The error you describe is not directly related to RadControls but to the way you want to render your user control through the WebService - you will reproduce it if you put another server control and it can also be reproduced without using RadToolTip and RadControls at all. You can find useful information in the forums on the net - e.g you can use the following search as a start point:

http://www.google.bg/search?hl=bg&rlz=1W1WZPA_en&q=Error+executing+child+request+for+handler+%27System.Web.UI.Page%27+web+service&meta=

I also understand that you are using a RadWindow now and in case you did not need the WebService you might consider using the RadToolTipManaher's Load On Demand functionality with AJAX :

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

Greetings,
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
Baal
Top achievements
Rank 1
answered on 07 Oct 2011, 03:51 PM
Sorry to be so so late on the reply. I fixed this a long time ago.

The problem was when I create a usercontrol as a page like this, the usercontrol needs a ScriptManager. Once I added it, it worked.

Thanks.
Tags
ToolTip
Asked by
Baal
Top achievements
Rank 1
Answers by
Baal
Top achievements
Rank 1
Svetlina Anati
Telerik team
Yavor
Telerik team
Rumen
Telerik team
Share this question
or