RadCalendar1_SelectionChanged

6 posts, 0 answers
  1. Regeesh Joseph
    Regeesh Joseph avatar
    55 posts
    Member since:
    May 2010

    Posted 02 Aug 2010 Link to this post

    Hai,

    RadCalendar1_SelectionChanged event is not firing on clicking the dates.

    Thanks & regards,
    Regeesh
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 03 Aug 2010 Link to this post

    Hello,

    Have you set the AutoPostBack property of RadCalendar to True?


    -Shinu.
  3. Regeesh Joseph
    Regeesh Joseph avatar
    55 posts
    Member since:
    May 2010

    Posted 03 Aug 2010 Link to this post

    Hai,

    I have set the AutoPostback to true, but it takes a lot of time to change the month. Is there any way to avoid postback on clicking the next month icon(> and <)  ?

    Thanks & regards
    Regeesh Joseph
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Aug 2010 Link to this post

    Hello,


    You can achieve the desired functionality by setting the AutoPostBack property from client side in corresponding events. Take a look at the following approach.

    aspx:
    <telerik:RadCalendar id="RadCalendar1" runat="server" AutoPostBack="True" OnSelectionChanged="RadCalendar1_SelectionChanged">         
        <ClientEvents OnCalendarViewChanging="OnCalendarViewChanging" OnDateClick="OnDateClick"/>         
    </telerik:RadCalendar>


    client code:
    <script type="text/javascript"
    function OnCalendarViewChanging(sender, eventArgs) 
        sender.set_autoPostBack(false); 
    function OnDateClick(sender, eventArgs) 
        sender.set_autoPostBack(true); 
    </script>


    code behind:
    protected void RadCalendar1_SelectionChanged(object sender, Telerik.Web.UI.Calendar.SelectedDatesEventArgs e) 
        // Your code here, when selecting date
    }


    -Shinu.
  5. Regeesh Joseph
    Regeesh Joseph avatar
    55 posts
    Member since:
    May 2010

    Posted 04 Aug 2010 Link to this post

    Hai Shinu,

    I have set as you suggested. But Javascript is not recognizing radcalendar. It is raising the error as : sender is undefined.

  6. Regeesh Joseph
    Regeesh Joseph avatar
    55 posts
    Member since:
    May 2010

    Posted 04 Aug 2010 Link to this post

    Hai,

    Thanks a lot. Javascript issue is solved after visual studio restart.
Back to Top