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

EnableAJAX="true" and RadToolTipManager

5 Answers 222 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
kamiln
Top achievements
Rank 1
kamiln asked on 02 Jul 2007, 09:06 PM
Hi I'm using the RadToolTipManager with a radgrid. As soon as any ajax request goes through none of the tooltips seem to appear. I got it to work using the radtooltip however my tooltips are loading user controls that have their own queries. The load time for radgrid then becomes too long. Is it possible to have Enableajax set to true, EnableAJAXScrollPaging and have the RadToolTipManager to work for an Icon on each row of my datagrid?

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
            {
                System.Web.UI.WebControls.Image image = (System.Web.UI.WebControls.Image)e.Item.FindControl("smallImage");
                GridDataItem dataItem = (GridDataItem)e.Item;
                image.ID = dataItem["TestId"].Text;
                this.RadToolTipManager1.TargetControls.Add(image.ClientID, true);

  protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
        {
            int index = args.TargetControlID.LastIndexOf("_");
            string elementId = args.TargetControlID.Substring(index + 1);

            decimal testId;

            if (decimal.TryParse(elementId, out testId))
            {
                this.UpdateToolTip(testId, args.UpdatePanel);
            }
        }

        private void UpdateToolTip(decimal testId, UpdatePanel panel)
        {
            Control control = Page.LoadControl("~/Controls/Preview/testPreview.ascx");
            panel.ContentTemplateContainer.Controls.Add(control);
            Mycontrol testtPreview = (Mycontrol)control;
            ((Mycontrol)control).testId = testId;
        }
Thanks.

5 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 06 Jul 2007, 01:31 PM
Hello kamiln,

We made a slight change to the RadToolTip control, that should help you in this scenario.
Attached is a trial version of the build.

However, before you give it a try, we suggest that you download the latest official  Prometheus build (the SP1 released on June 26th), because the RadTooltipManager should work properly as well (and in case you are satisified with the result you will also be able to download the developer's version easily).

There is one change that you need to make in your code, however.
For the example to work properly, you will need to turn off RadGrid's internal AJAX (EnableAjax = false), and wrap the grid in a MS AJAX UpdatePanel, e.g.

 
<asp:UpdatePanel ID="Panel1" runat=server UpdateMode=Conditional>  
<ContentTemplate> 
 
<radG:RadGrid EnableAJAX="false" runat="server" >....  
</radG:RadGrid> 
 
 
</ContentTemplate> 
</asp:UpdatePanel> 



Best wishes,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
kamiln
Top achievements
Rank 1
answered on 06 Jul 2007, 07:18 PM

Thank you for your response. I updated the dll and still the result is the same. If I remove update panel everything works fine however the page does a full postback. Is there a working example you have I could compare with?

    <asp:UpdatePanel ID="Panel1" runat=server UpdateMode=Conditional>  
<ContentTemplate> 

        <radG:RadGrid ID="RadGrid1" Skin="Office2007" ShowGroupPanel="True" ClientSettings-AllowDragToGroup="true"
            ClientSettings-AllowColumnsReorder="true" runat="server" AllowSorting="True"
            EnableAJAX="false" PageSize="10" AllowPaging="true" Width="98%" ShowStatusBar="true" GridLines="none"
            
            OnNeedDataSource="RadGrid1_NeedDataSource"
            OnItemCommand="RadGridItemCommand"
            OnUpdateCommand="RadGrid1UpdateCommand"
            OnDeleteCommand="RadGrid1DeleteCommand"
            OnItemDataBound="RadGrid1_ItemDataBound"
            
            OnEditCommand="RadGrid1_EditCommand"
            OnItemCreated="RadGrid1_ItemCreated"
            AllowMultiRowSelection="True"
            AllowMultiRowEdit="true"
            PagerStyle-AlwaysVisible="true"
            AllowCustomPaging="true"
         onpageindexchanged="RadGrid1_PageIndexChanged"
            EnableAJAXLoadingTemplate="true"
            LoadingTemplateTransparency="50">
           <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
          
            <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                <Resizing AllowRowResize="True" AllowColumnResize="True"></Resizing>
                <Selecting AllowRowSelect="true" />
                <ClientEvents OnRowContextMenu="RowContextMenu" OnGridCreated="GridCreated" OnRowSelected="RowSelected" OnRowDblClick="RowDblClick"></ClientEvents>
                <Scrolling AllowScroll="True" EnableAJAXScrollPaging="True" UseStaticHeaders="True"></Scrolling>
            </ClientSettings>
         
            <MasterTableView EditMode="inPlace" DataKeyNames="InvoiceId" Width="98%" AutoGenerateColumns="false" CommandItemDisplay="Top">
              

0
Georgi Tunev
Telerik team
answered on 09 Jul 2007, 10:51 AM
Hello Kamiln,

We don't have such example, but if you can isolate the problem in a small sample project and send it to us in a new support ticket (you cannot attach files in the forum), we will check it right away. Once we have a better view over your exact scenario, we will do our best to help.


Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
kamiln
Top achievements
Rank 1
answered on 10 Jul 2007, 07:10 PM
Hi,

I believe I've isolated the problem down. On my NeedDataSource event I'm only retrieving the number of records required for the grid's selected page to display. As soon as I removed my take / skip paramaters and in fact query the entire table than the Ajaxtooltipmanager works fine.  I'm dealing with large tables and making these large queries is not an option. Do you have any recommendation how I can resolved this? It seems the agaxtooltipmanager is only aware of the first datagrid page but any page changes thereafter renders it inactive.

protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            int skip = RadGrid1.CurrentPageIndex * this.RadGrid1.PageSize;
            int take = skip + this.RadGrid1.PageSize;

            var query = (from i in Invoices)
            if (RadGrid1.VirtualItemCount.Equals(0))
                RadGrid1.VirtualItemCount = query.Count();

           RadGrid1.DataSource = query.Skip(skip).Take(take);        }

Thanks.

0
Tsvetie
Telerik team
answered on 16 Jul 2007, 01:17 PM
Hi kamiln,
I tried to reproduce the problem you describe, but to no avail. We will really need a simple running project that demonstrates this issue in order to help you handle it. Therefore, please prepare one and send it to us in a new support ticket.

All the best,
Tsvetie
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ToolTip
Asked by
kamiln
Top achievements
Rank 1
Answers by
Tervel
Telerik team
kamiln
Top achievements
Rank 1
Georgi Tunev
Telerik team
Tsvetie
Telerik team
Share this question
or