RadToolipManager with RadCalendar and MultiView

7 posts, 0 answers
  1. Nikolas G
    Nikolas G avatar
    11 posts
    Member since:
    Oct 2009

    Posted 16 Feb 2010 Link to this post

    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!!

  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 19 Feb 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nikolas G
    Nikolas G avatar
    11 posts
    Member since:
    Oct 2009

    Posted 19 Feb 2010 Link to this post

    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
  5. Nikolas G
    Nikolas G avatar
    11 posts
    Member since:
    Oct 2009

    Posted 22 Feb 2010 Link to this post

    any idea??
  6. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 24 Feb 2010 Link to this post

    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.
  7. Nikolas G
    Nikolas G avatar
    11 posts
    Member since:
    Oct 2009

    Posted 24 Feb 2010 Link to this post

    Everything worked OK!!

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




  8. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 24 Feb 2010 Link to this post

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