RadGrid tooltip via webservice

10 posts, 0 answers
  1. Baal
    Baal avatar
    47 posts
    Member since:
    Mar 2008

    Posted 23 Apr 2010 Link to this post

    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.
  2. Baal
    Baal avatar
    47 posts
    Member since:
    Mar 2008

    Posted 27 Apr 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 28 Apr 2010 Link to this post

    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.
  5. Baal
    Baal avatar
    47 posts
    Member since:
    Mar 2008

    Posted 21 Jul 2010 Link to this post

    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.
  6. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 28 Jul 2010 Link to this post

    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
  7. Baal
    Baal avatar
    47 posts
    Member since:
    Mar 2008

    Posted 28 Jul 2010 Link to this post

    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.
  8. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 02 Aug 2010 Link to this post

    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
  9. Baal
    Baal avatar
    47 posts
    Member since:
    Mar 2008

    Posted 10 Sep 2010 Link to this post

    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.
  10. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 13 Sep 2010 Link to this post

    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
  11. Baal
    Baal avatar
    47 posts
    Member since:
    Mar 2008

    Posted 07 Oct 2011 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017