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

Not Update Tooltip

5 Answers 161 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Amitkumar
Top achievements
Rank 1
Amitkumar asked on 14 Apr 2010, 08:29 AM
Hello I m Using Tooltipmanger
onLoad i m calling other user control
on that usercontrol i used a RadDock and inside Raddock i m using GRID.
Problem is tooltip is not able update.

ToolTipPage
  <asp:UpdatePanel ID="upPanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
            <telerik:RadToolTipManager runat="server"   
            HideEvent="LeaveToolTip" ID="RadToolTipManager1" Width="100px"
    Height="100px" RelativeTo="Element"
            Animation="Slide" Position="BottomRight" OnAjaxUpdate="OnAjaxUpdate"
    Skin="Telerik" BorderStyle="None">           
            
            </telerik:RadToolTipManager>
               </ContentTemplate>
</asp:UpdatePanel>

ToolTipPageOn Code:-
 protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
        {
            

                this.UpdateToolTip(args.Value, args.UpdatePanel);
        }


 private void UpdateToolTip(string elementID, UpdatePanel panel)
        {
         
            if (elementID.ToString() == "Information")
            {
               
                Control ctrl = Page.LoadControl("UserControls/statusTooltip.ascx");
                panel.ContentTemplateContainer.Controls.Add(ctrl);
                statusTooltip details = (statusTooltip)ctrl;
                details.ID = elementID;
               

            }
            else if (elementID.ToString() == "Types")
            {
                panel.ContentTemplateContainer.Controls.Clear();



                Control ctrlAttendeeTypesTooltip = Page.LoadControl("UserControls/Types.ascx");
                panel.ContentTemplateContainer .Controls.Add(ctrlAttendeeTypesTooltip);
                Types detailsAttendeeTypesTooltip = (Types)ctrlAttendeeTypesTooltip;
                detailsAttendeeTypesTooltip.ID = elementID;
             
            }
}








UserControl

 <telerik:RadDock ID="RadDock2" Title="Agenda Locations" runat="server" Width="200px" Height="350px" DefaultCommands="None">
            <ContentTemplate>
                                    
                                     <table>
                                     <tr>
                                     <td>
                                     <telerik:RadGrid ID="rgds" runat="server"
                                    AllowMultiRowSelection="True"
                                    OnNeedDataSource="rgds_NeedDataSource" ShowHeader="false"
                                    AutoGenerateColumns="False"
                                              GridLines="None"
                                   PagerStyle-AlwaysVisible="true"   
                                   
                                     AllowFilteringByColumn="false"
                                    >
                                   
                                </telerik:RadGrid>
                                        
                                     
                                     </td>
                                    
                                     </tr>
                                       
                                     </table>
                                         
                                     
                                  </ContentTemplate>
        </telerik:RadDock>

UserControl.cs

 protected void rgds_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {

            try
            {
                this.LoadGridrg();
               
                
            }
            catch (Exception ex)
            {
            
            }
        }

Please i try all solution but still notable to update.

5 Answers, 1 is accepted

Sort by
0
Amitkumar
Top achievements
Rank 1
answered on 15 Apr 2010, 01:51 PM
Solved Just write in PageSource EnableViewState = False
0
Prince Dakkar (AKA Captain Nemo)
Top achievements
Rank 1
answered on 17 May 2010, 06:57 PM
I encountered the similar situation and for me EnableViewState = false did not work.

My RadToolTipManager tag was placed outside the Update Panel in the page and therefore did not update its client state upon postback.

I had to place the RadToolTipManager tag inside the UpdatePanel and then it worked.

0
John
Top achievements
Rank 1
answered on 17 May 2010, 11:18 PM

I have a RadChart inside a RadPageView and a RadMultiPage.  The page I am working on is a content page.

In the page_load I am getting a dataset and then building a chart and adding a Tooltip to the ActiveRegions of the Series in a chart.

I am also using a RadAjaxManagerProxy and am using it to handle as much as possible.

However, when I click a radiobutton to update the Data for the chart, the ActiveRegion tooltips are not updating.

I think I've tried everything, but clearly not.

How / when / where do I clear the ActiveRegion of ToolTips for a RadChart?

Thanks,
John

0
John
Top achievements
Rank 1
answered on 18 May 2010, 07:52 PM
Well, I solved my problem by putting the  RadToolTipManager in each AjaxSetting of my RadAjaxManagerProxy.
0
Svetlina Anati
Telerik team
answered on 19 May 2010, 02:43 PM
Hello guys,

I am not completely sure I understand you correctly but as far as I understood you experience problems with setting values inside the tooltip. Note that when we add to the tooltip controls with ViewState we have to make sure that these controls are created before the LoadViewState event fires so that their ViewState information is loaded. In order to avoid forcing our clients to recreate all their controls in the Init event on postback, we decided to fire the AjaxUpdate event earlier in the page lifecycle. That is why the RadChart takes its old data from the ViewState and does not get updated.

In order to get the desired result, you should set the new value in the RadChart's PreRender event, e.g as shown below:

protected string targetID = null;   
    protected RadChart chart1= null;   
    protected void OnAjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs args)   
    {   
        args.UpdatePanel.ContentTemplateContainer.Controls.Add(new LiteralControl("<div>" + args.TargetControlID + "</div>"));   
        RadChart chart = new RadChart();   
        chart.Series.Add(new Telerik.Charting.ChartSeries());   
        targetID = args.TargetControlID;   
        chart1 = chart;   
        chart.PreRender += new EventHandler(chart_PreRender);   
        args.UpdatePanel.ContentTemplateContainer.Controls.Add(chart);   
    }   
    
    void chart_PreRender(object sender, EventArgs e)   
    {   
        chart1.Series[0].Name = targetID;   
    }  



In case you have a lot of controls and not only a RadChart, I recommend to wrap them in a user control and set the desired values in the user control's PreRender event in order to avoid attaching prerender handlers to every control with a ViewState.

I hope that my explanations were detailed and clear enough - lt me know if you continue experiencing problems or in case this is not the problem you report provide more detailed explanations and I will do my best to help.


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.
Tags
ToolTip
Asked by
Amitkumar
Top achievements
Rank 1
Answers by
Amitkumar
Top achievements
Rank 1
Prince Dakkar (AKA Captain Nemo)
Top achievements
Rank 1
John
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or