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

RadToolipManager with RadCalendar and MultiView

6 Answers 84 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Nikolas G
Top achievements
Rank 1
Nikolas G asked on 16 Feb 2010, 03:14 PM
Hi

I have a Multiview that contains a  RadCalendar and a RadToolTipManager that shows tooltips for each day. Inside each tooltip contains data about that specific date and a button that needs to redirect the user to another View of the same page.

But when I click the button nothing happens. When I close the RadToolTip and press some other day it redirects me to that other View.

Does this have to do with VIEWSTATE?? 

THnx a lot!!

6 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 19 Feb 2010, 09:28 AM
Hi Nikolas G,

Wold you please provide some additional details about your setup - e.g how do you load the content and how do you redirect? What I assume is that you are using the OnAjaxUpdate event and you redirect by using Response.Redirect method. If so, however, you should get an error which is related to MS AJAX - when you use OnAjaxUpdate, you load the content with AJAX and Response.Redirect method is not supported by MS AJAX. As there is no real 'Response', methods like Response.Redirect and Response.Write will not work with AJAX.  You can try javascript redirect, e.g similar to  Page.ClientScript.RegisterStartupScript(this.GetType(), "redirect", "location.href = 'SomePage.aspx'", true); 


You can read more about this in the article below:

http://msdn.microsoft.com/en-us/library/bb386454.aspx

Regards,
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
Nikolas G
Top achievements
Rank 1
answered on 19 Feb 2010, 01:01 PM
Its a bit complicated

I Have a Page that contains on one view

 a Calendar where its page has a tooltip for reservation Info

and on the other view

a reservation form for new reservation or for reservation update

<html xmlns="http://www.w3.org/1999/xhtml"
<head id="Head2" runat="server"
    <title>Home Page header </title> 
    <link href="../mainCSS.css" rel="stylesheet" type="text/css" /> 
    <telerik:radcodeblock id="RadCodeBlock1" runat="server"
 
        <script type="text/javascript"
            function ShowToolTip(sender) { 
                var tooltipManager = $find("<%=RadToolTipManager2.ClientID %>"); 
 
                //If the user hovers the image before the page has loaded, there is no manager created 
                if (!tooltipManager) return; 
 
                //Find the tooltip for this element if it has been created  
                var tooltip = tooltipManager.getToolTipByElement(sender); 
 
                //Create a tooltip if no tooltip exists for such element 
                if (!tooltip) { 
                    tooltip = tooltipManager.createToolTip(sender); 
                    var longValue = sender.getAttribute("ID"); 
                    var neededValue = longValue.substring(longValue.indexOf('_') + 1) 
                    tooltip.set_value(neededValue); 
                    tooltip.show(); 
                } 
            } 
 
        </script> 
    </telerik:radcodeblock> 
</head> 
<body> 
 
        <form id="PropertyLocationForm" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server"
        </asp:ScriptManager> 
        <div> 
            <asp:MultiView ID="MultiViewAvaibility" runat="server"
                <asp:View ID="ViewCalendar" runat="server"
                    <asp:Button ID="Button1" runat="server" Text="Νεα Ιδιοκτησία" ValidationGroup="ValidationIdioktisia" 
                        OnClick="Button1_Click1" /> 
                    <table width="100%"
                        <tr> 
                            <td> 
                                <telerik:radtooltipmanager width="300px" skin="Windows7" height="400px" hideevent="ManualClose" 
                                    relativeto="Element" id="RadToolTipManager2" runat="server" position="Center" 
                                    autotooltipify="false" onajaxupdate="RadToolTipmanager1_AjaxUpdate"
                                </telerik:radtooltipmanager> 
                                <telerik:radcalendar id="RadCalendar2" runat="server" enablemonthyearfastnavigation="false" 
                                    autopostback="true" onprerender="Calendar1_DayPreRender" ondayrender="Calendar1_DayRender" 
                                    operationtype="Server" showrowheaders="false" enablemultiselect="true" presentationtype="Preview" 
                                    showothermonthsdays="false" skin="Windows7" multiviewcolumns="4" multiviewrows="3" 
                                    ondefaultviewchanged="RadCalendar_DefaultViewChanged1"
                                    <CalendarDayTemplates> 
                                        <telerik:DayTemplate ID="EndDay" runat="server"
                                            <Content> 
                                                <img src="../Images/end.png" alt="" style="background-image" /> 
                                            </Content> 
                                        </telerik:DayTemplate> 
                                    </CalendarDayTemplates> 
                                </telerik:radcalendar> 
                            </td> 
                        </tr> 
                    </table> 
                </asp:View> 
                <asp:View ID="ViewReservation" runat="server" OnLoad="TabReservation_Activate"
                    <!-- Here is Located the Reservation Form--> 
                </asp:View> 
            </asp:MultiView> 
        </div> 
        </form> 
 
</body> 
</html> 

Here is the .cs

  // update of tooltip 
        protected void RadToolTipmanager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs e) 
        { 
            // create an appointment details  class
            AppointmentDetails details = (AppointmentDetails)this.LoadControl("OwnerPropertyCreator/AppointmentDetails.ascx"); 
            details.AppointmentID = int.Parse(e.Value); 
            e.UpdatePanel.ContentTemplateContainer.Controls.Add(details); 
       } 


and the AppointMentDetails cs


  public partial class AppointmentDetails : System.Web.UI.UserControl 
    { 
        private int appointmentID; 
 
        public int AppointmentID 
        { 
            get { return appointmentID; } 
            set { appointmentID = value; } 
        } 
 
        protected void Page_PreRender(object sender, EventArgs e) 
        { 
            this.AppointmentsDataSource.SelectParameters["KratisiId"].DefaultValue = this.AppointmentID.ToString(); 
            ProductsView.DataBind(); 
        } 
 
        protected void Button1_Click(object sender, EventArgs e) 
        { 
       
 
 
            MultiView mv = (MultiView)Page.FindControl("MultiViewAvaibility"); 
            mv.ActiveViewIndex = 1; 
 
         
      ); 
        } 
    } 


when I click the button on the tooltip it changes view only after I close and open another tooltip..

Thnx Very much for the HELP. I am working on it for 2 weeks.. and still no solution

thnx
0
Nikolas G
Top achievements
Rank 1
answered on 22 Feb 2010, 09:57 PM
any idea??
0
Svetlina Anati
Telerik team
answered on 24 Feb 2010, 12:22 PM
Hello Nikolas G,

I examine the code, built up a test demo based on it and I was able to observe the described result. This is expected since the button is in the tooltip's update panel and thus only the content inside the tooltip gets updated - that is why the multiview which is on the main page is not updated. In order to get the desired result you should wrap it in an update panel with UpdateMode="Conditional" and update it through the method Update() after you change the index. For your convenience I attached a sample demo to the thread.

On a side note, forums are considered community resources and we do not guarantee a timely response here - if you want to ensure that you will get a fast and guaranteed response from us, please examine our support offers.

Best wishes,
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
Nikolas G
Top achievements
Rank 1
answered on 24 Feb 2010, 12:32 PM
Everything worked OK!!

You are so kind I would like to thank you very very much!!!




0
Svetlina Anati
Telerik team
answered on 24 Feb 2010, 01:03 PM
Hi Nikolas G,

Thank you for the good words, I am glad I could help! In case you experience any further problems, do not hesitate to contact us again, we will be glad 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
Nikolas G
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Nikolas G
Top achievements
Rank 1
Share this question
or