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

RadCalendar Postback

2 Answers 57 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Elvis
Top achievements
Rank 2
Elvis asked on 04 Dec 2008, 10:24 PM

I need help figuring out why my sharedcalendar creates a postback (which refreshes the entire pages, like if I had no AJAX) after the user clicks to change months,

      <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
        telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadCalendar2">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadCalendar2" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="RadDatePicker1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadDatePicker1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
 
 
    <telerik:RadDatePicker ID="RadDatePicker1" runat="server" Culture="English (United States)" Skin="Telerik" SharedCalendarID="radcalendar2">  
      <DateInput runat="server" LabelCssClass="radLabelCss_Telerik" Skin="Telerik">  
      </DateInput> 
      <Calendar runat="server" Skin="Telerik" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">  
      </Calendar> 
 <DatePopupButton CssClass="radPopupImage_Telerik" /  
 

 

2 Answers, 1 is accepted

Sort by
0
Elvis
Top achievements
Rank 2
answered on 05 Dec 2008, 02:43 AM
I found a solution to my initial problem by reading: http://www.telerik.com/community/forums/aspnet-ajax/calendar/month-navigation-causes-postback.aspx

The problem now is that after the user changes a month special days are not maintained. I'm guessing that its caused due to the calendar not longer firing a postback and therefore my on load sub is not being called.

Here  is my sub:
    Protected Sub addSpecialDays()  
        'grab holidays & floatings  
        Dim x As New GlobalClass  
        Dim xarr As New ArrayList : Dim xarr2 As New ArrayList : Dim n As Integer = 0  
        xarr = x.getXarrADV("SELECT name from tHolidays where type = 'holiday'")  
        xarr2 = x.getXarrADV("SELECT date from tHolidays where type = 'holiday'")  
 
        Dim dayn(xarr.Count) As Telerik.Web.UI.RadCalendarDay  
        While n < xarr.Count  
            dayn(n) = New Telerik.Web.UI.RadCalendarDay  
 
            dayn(n).ToolTip = xarr.Item(n)  
            dayn(n).Date = xarr2.Item(n)  
            dayn(n).Repeatable = Telerik.Web.UI.Calendar.RecurringEvents.DayAndMonth  
            dayn(n).ItemStyle.BorderColor = Drawing.Color.DarkRed  
            RadCalendar2.SpecialDays.Add(dayn(n))  
            RadCalendar2.FocusedDate = Now.Date 
            n = n + 1  
        End While 
 
    End Sub 
0
Maria Ilieva
Telerik team
answered on 08 Dec 2008, 11:33 AM
Hi Elvis,

In order to have the application works properly and the special days to apply on each month after navigation the AutoPost back property of the control should be set to "true"

All the best,
Maria Ilieva
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Calendar
Asked by
Elvis
Top achievements
Rank 2
Answers by
Elvis
Top achievements
Rank 2
Maria Ilieva
Telerik team
Share this question
or