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

2 posts, 1 answers
  1. Jalil
    Jalil avatar
    3 posts
    Member since:
    Mar 2016

    Posted 21 Jun Link to this post

    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

  2. Answer
    Ivan Danchev
    Admin
    Ivan Danchev avatar
    837 posts

    Posted 24 Jun Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top