AutoPostback only when enddate of range is selected?

3 posts, 1 answers
  1. Duncan
    Duncan avatar
    93 posts
    Member since:
    Jul 2012

    Posted 09 Nov 2011 Link to this post

    Is it possible to setup the calendar to ONLY postback when the end date of a range is selected. Right now i have AutoPostback set, but it is obviously posting back when the start date of the range is selected which returns no results some times.

    Any help would be great!

    Duncan
  2. Answer
    Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 14 Nov 2011 Link to this post

    Hello Duncan,

    You could use this solution:

    <script type="text/javascript">
      function onDateClick(sender, eventArgs)
      {
        var endDate = sender.get_rangeSelectionEndDate();
        sender.set_autoPostBack(endDate ? true : false);
      }
    </script>
    <telerik:RadCalendar runat="server" AutoPostBack="true" RangeSelectionMode="OnKeyHold">
      <ClientEvents OnDateClick="onDateClick" />
    </telerik:RadCalendar>


    Greetings,
    Vasil
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Duncan
    Duncan avatar
    93 posts
    Member since:
    Jul 2012

    Posted 14 Nov 2011 Link to this post

    Worked perfectly... Thank you!
Back to Top