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

How to Get Start date and end date from selection of scheduler

1 Answer 209 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jalil
Top achievements
Rank 1
Jalil asked on 21 Jun 2016, 12:16 PM

Hi

    I am using radscheduler, I need to  select multiple dates from the month view of scheduler, I would like to get start date and end date of my selection.

How is that possible in C#?

It is urgent therefore a quick response would be greatly appreciated.

Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan Danchev
Telerik team
answered on 24 Jun 2016, 08:19 AM
Hello Jalil,

The selection of timeslots is not available on the server. You can get it on the client by subscribing to the Scheduler's OnClientTimeSlotClick event and calling the Scheduler's get_selectedSlots() method:
function OnClientTimeSlotClick(sender, args) {
    var slots = sender.get_selectedSlots();
    var start = slots[0].get_startTime();
    var end = slots[slots.length - 1].get_endTime();
 
    $telerik.$("#HiddenFieldStart").val(start);
    $telerik.$("#HiddenFieldEnd").val(end);
}

The get_selectedSlots() method returns a collection of the selected TimeSlots. You can then get the first slot's StartTime and the last slot's EntTime and save them into hiddenfield controls:
<asp:HiddenField runat="server" ID="HiddenFieldStart" />
<asp:HiddenField runat="server" ID="HiddenFieldEnd" />

which you can access on the server on the next postback.

Regards,
Ivan Danchev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Scheduler
Asked by
Jalil
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or