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

AutoPostback only when enddate of range is selected?

2 Answers 52 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Duncan
Top achievements
Rank 2
Duncan asked on 09 Nov 2011, 07:33 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Vasil
Telerik team
answered on 14 Nov 2011, 09:15 AM
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
0
Duncan
Top achievements
Rank 2
answered on 14 Nov 2011, 10:09 PM
Worked perfectly... Thank you!
Tags
Calendar
Asked by
Duncan
Top achievements
Rank 2
Answers by
Vasil
Telerik team
Duncan
Top achievements
Rank 2
Share this question
or