RadTooltip within Infragistics UltrawebGrid and WebAsyncRefreshPanel

4 posts, 0 answers
  1. Ciaran
    Ciaran avatar
    2 posts
    Member since:
    Nov 2007

    Posted 09 Nov 2007 Link to this post

    Trying to get the tooltip to work within a TemplatedColumn in the UltrawebGrid which is itself within a WebAsyncRefreshPanel.  Followed the example for the RadToolTipManager and added controls to the RadToolTipManager's TargetControls collection within the Grids InitializeRow event handler. 

    The issue I have is that the AjaxUpdate event handler on the RadToolTipManager never fires.  The RadToolTipManager's TargetControls collection gets populated correctly with the link control ClientID from within the TemplatedColumn.   So is RadToolTip on a TemplatedColumn in a UltrawebGrid within a WebAsyncRefreshPanel using the RadToolTipManager just a bad idea or am I missing something simple?
  2. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 12 Nov 2007 Link to this post

    Hi Ciaran,

    If you followed the RadToolTipManager example and set all ID's OK there should not be any problem.

    Do you actually see the tooltip shown like a little rectangle when you hover over an item?
    If you don't then probably the problem is not with the OnAjaxUpdate not firing, but the tooltipmanager not being fed with proper client ID's.

    Please check whether the ID's do match existing elements on the page by examining the client-side page source ("View Page Source" browser option).


    In case you are not able to resolve the problem, it is best to send us a simple project that reproduces the issue and we will delve further into it.

    Regards,
    Tervel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Ciaran
    Ciaran avatar
    2 posts
    Member since:
    Nov 2007

    Posted 14 Nov 2007 Link to this post

    Thanks for the response. I have attached sample ASPX/C# code working against Northwind that contains a simulation of what I am doing.

    I have a WARP Panel which contains 2 ASP Panels (one for a search form and the other for the search results grid). Clicking on the button in the iniial visible panel will toggle the panels within the WARP Panel and populate the grid in the other panel. In this scenario, the ToolTip does not work and gives a JavaScript error “Sys.InvalidOperationException: The PageRequestManager cannot be initialized more than once” when the cursor is over the Order column (which shows the ClientID for the links within the Grid TemplatedColumn).

    Also, I noticed that the ToolTip when working (by populating and showing the grid on initial page load) does not position itself correctly when the page is scrolled vertically. It seems to stop at the initial page footer.

    Thanks for your assistance.

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
     
    <%@ Register Assembly="Infragistics2.WebUI.Misc.v7.2, Version=7.2.20072.61, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" 
        Namespace="Infragistics.WebUI.Misc" TagPrefix="igmisc" %> 
     
    <%@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v7.2, Version=7.2.20072.61, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" 
        Namespace="Infragistics.WebUI.UltraWebGrid" TagPrefix="igtbl" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
        <title>Untitled Page</title> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
          
            <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1"   
                runat="server"   
                Width="100%"   
                Height="100%">      
                  
                <asp:ScriptManager ID="ScriptManager1" runat="server" />              
                <telerik:RadToolTipManager ID="RadToolTip1" runat="server" 
                    Position="MiddleRight" 
                    RelativeTo="Element"   
                    Animation="None" 
                    OnAjaxUpdate="RadToolTip1_AjaxUpdate" /> 
                  
                <asp:Panel ID="pnlOrders" Visible="false" runat="server">  
                    <asp:Button ID="btnBack" Text="Back To Form" runat="Server" OnClick="btnBack_Click" /> 
                    <igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server"   
                        OnInitializeRow="UltraWebGrid1_InitializeRow" > 
                        <Bands> 
                            <igtbl:UltraGridBand> 
                                <Columns> 
                                    <igtbl:UltraGridColumn BaseColumnName="Order ID" DataType="System.Int32" IsBound="True" 
                                        Key="Order ID">  
                                        <Header Caption="Order ID">  
                                            <RowLayoutColumnInfo OriginX="0" /> 
                                        </Header> 
                                    </igtbl:UltraGridColumn> 
                                    <igtbl:TemplatedColumn> 
                                        <CellTemplate> 
                                            <asp:HyperLink ID="hlOrder" runat="Server" Text="View Order"></asp:HyperLink> 
                                        </CellTemplate> 
                                        <Header Caption="Order">  
                                            <RowLayoutColumnInfo OriginX="1" />                                  
                                        </Header> 
                                    </igtbl:TemplatedColumn> 
                                    <igtbl:UltraGridColumn BaseColumnName="Customer" IsBound="True" Key="Customer">  
                                        <Header Caption="Customer">  
                                            <RowLayoutColumnInfo OriginX="2" />                                      
                                        </Header> 
                                    </igtbl:UltraGridColumn> 
                                    <igtbl:UltraGridColumn BaseColumnName="Employee" IsBound="True" Key="Employee">  
                                        <Header Caption="Employee">  
                                            <RowLayoutColumnInfo OriginX="3" /> 
                                        </Header> 
                                    </igtbl:UltraGridColumn> 
                                    <igtbl:UltraGridColumn BaseColumnName="Order Date" IsBound="True" Key="Order Date">  
                                        <Header Caption="Order Date">  
                                            <RowLayoutColumnInfo OriginX="4" /> 
                                        </Header> 
                                    </igtbl:UltraGridColumn> 
                                    <igtbl:UltraGridColumn BaseColumnName="Shipped Date" IsBound="True" Key="Shipped Date">  
                                        <Header Caption="Shipped Date">  
                                            <RowLayoutColumnInfo OriginX="5" />                                      
                                        </Header> 
                                    </igtbl:UltraGridColumn> 
                                </Columns> 
                            </igtbl:UltraGridBand> 
                              
                        </Bands> 
                        <DisplayLayout CellPaddingDefault="5" /> 
                    </igtbl:UltraWebGrid> 
                </asp:Panel> 
                  
                <asp:Panel ID="pnlFilterForm" runat="server">  
                    <p>Simulated Search Form</p> 
                    <asp:Button ID="btnShow" Text="Show Results" runat="Server" OnClick="btnShow_Click" /> 
                </asp:Panel> 
                  
            </igmisc:WebAsyncRefreshPanel>    
             
        </form> 
    </body> 
    </html> 


    using System;  
    using System.Data;  
    using System.Data.OleDb;  
    using System.Configuration;  
    using System.Web;  
    using System.Web.Security;  
    using System.Web.UI;  
    using System.Web.UI.WebControls;  
    using System.Web.UI.WebControls.WebParts;  
    using System.Web.UI.HtmlControls;  
     
    using Infragistics.WebUI.UltraWebGrid;  
     
    public partial class _Default : System.Web.UI.Page   
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            //FillGrid();  
        }  
     
        protected void btnShow_Click(object sender, EventArgs e)  
        {  
     
            FillGrid();  
        }  
     
        protected void btnBack_Click(object sender, EventArgs e)  
        {  
            pnlFilterForm.Visible = true;  
            pnlOrders.Visible = false;  
     
            UltraWebGrid1.Clear();  
        }  
     
        private void FillGrid()  
        {  
            DataSet myDS = new DataSet();  
     
            OleDbConnection myConn = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0; Data Source=" + Server.MapPath("~/app_data/Northwind.mdb"));  
            OleDbDataAdapter myAdapt = new OleDbDataAdapter("SELECT Top 100 * FROM Orders", myConn);  
     
            myAdapt.Fill(myDS);  
     
            UltraWebGrid1.DataSource = myDS;  
            UltraWebGrid1.DataBind();  
     
            pnlFilterForm.Visible = false;  
            pnlOrders.Visible = true;  
        }  
     
        protected void UltraWebGrid1_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)  
        {  
            TemplatedColumn col = (TemplatedColumn)UltraWebGrid1.Columns[0];  
            CellItem ci = (CellItem)col.CellItems[e.Row.BandIndex];  
            HyperLink hlOrder = (HyperLink)ci.FindControl("hlOrder");  
     
            hlOrder.Text = hlOrder.ClientID;  
     
            RadToolTip1.TargetControls.Add(hlOrder.ClientID, true);  
        }  
     
        protected void RadToolTip1_AjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e)  
        {  
            string target = e.TargetControlID.ToString();  
     
            Label myTime = new Label();  
            myTime.Text = DateTime.Now.ToLongTimeString();  
            e.UpdatePanel.ContentTemplateContainer.Controls.Add(myTime);  
        }  
     
     


  4. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 15 Nov 2007 Link to this post

    Hello Ciaran,
    Based on the information you provided, I was able to reproduce the problem with the position of the RadToolTip when you have scrolled down the page and forwarded it to our developers. We will fix it as soon as possible.

    However, for the problem with the UltrawebGrid, we will need a whole test project, that we can run without modifications and that is why I will ask you to open a new support ticket and send us such a project as an attachment. As soon as we have a project, we will do our best to find the cause for the js error.

    Kind regards,
    Tsvetie
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top