Get Recource Timeslot key

2 posts, 0 answers
  1. Sander
    Sander avatar
    13 posts
    Member since:
    Aug 2011

    Posted 02 Sep 2011 Link to this post

    Hi there,

    At the moment I am working with recourses. I have 2 agenda's in my scheduler now. But I have a problem. I am working with schemes. And one person has another scheme than another person. When a person clicks on a timeslot I have to check if the person create an appointment and not outside of that scheme. How can I get the timeslot resource key when clicking on a timeslot? I need it in C#.

    I hope someone can help me.

    Thanks in advance.

    Sander
  2. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 06 Sep 2011 Link to this post

    Hi Sander,

    You can subscribe to the client event OnClientTimeSlotClick and get the TimeSlot's resource in there. Then you can use RadAjaxManager  to make an Ajax Request to the server having the resource key as an argument of the ajaxRequest method.

    JS and RadAjaxManager:
    <telerik:RadCodeBlock runat="server">
            <script type="text/javascript">
                function radScheduler1_clientTimeSlotClick(sender, eventArgs) {
                    var timeSlot = eventArgs.get_targetSlot();
                    //If the current View is grouped by Resource,
                    //returns the Resource object. Otherwise, returns null.
                    var resource = timeSlot.get_resource();
                    if (timeSlot.get_resource) {
                        $find("<%=RadAjaxManager1.ClientID %>").ajaxRequest(resource.get_key());
                    }
                }
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

    More info about the SchedulerTimeSlot's methods and properties you can find in the following article:
    SchedulerTimeSlot and SchedulerModel.

    Regards,
    Ivana
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top