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

[Solved] Any way to handle an add appointment (schedule click) serverside?

3 Answers 167 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Chris Trina
Top achievements
Rank 1
Chris Trina asked on 05 Jan 2010, 01:15 PM
I need to be able to process a schedule click event serverside, is there any way to do this?  Also, ideally I need access to the date and time that coorespond with where they clicked in the schedule.  I've tried all of the serverside events but can't find one for this.

Thanks

Chris

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Jan 2010, 02:17 PM
Hello Chris,

You can attach 'AppointmentClick' event if you want to invoke server event when user clicks on an appointment.

And if you want to execute any server code when user clicking on TimeSlot, then one suggestion to accomplish this is attaching ClicentSide event 'OnClientTimeSlotClick' to RadScheduler and invoking an ajaxRequest to server as shown below.

ASPX:
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadScheduler1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
 
   <telerik:RadScheduler OnClientAppointmentDoubleClick="OnClientAppointmentDoubleClick" 
            ID="RadScheduler1" StartInsertingInAdvancedForm="false" runat="server" DataEndField="End" 
            DataKeyField="ID" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID" 
            DataSourceID="SqlDataSource2" DataStartField="Start" DataSubjectField="Subject" 
            OnClientTimeSlotClick="OnClientTimeSlotClick"
   </telerik:RadScheduler> 

JavaScript:
 
    function OnClientTimeSlotClick(sender, args) {       
        var time = args.get_time().localeFormat('MM/dd/yyyy hh:mm:ss'); 
        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); 
        ajaxManager.ajaxRequest(time); 
    } 

CS:
 
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e) 
    { 
        String time = e.Argument.ToString(); 
        DateTime dt = (DateTime)Convert.ToDateTime(time); 
    } 

-Shinu.
0
Roffe
Top achievements
Rank 1
answered on 24 Feb 2010, 10:49 AM
If you have grouped by resource, how could you also get the correct resource ?
0
T. Tsonev
Telerik team
answered on 25 Feb 2010, 10:22 AM
Hello Carl,

The resource is available through the get_resource() property. Full reference here:
http://www.telerik.com/help/aspnet-ajax/client-side-objects-schedulertimeslot-and-schedulermodel.html

Sincerely yours,
Tsvetomir Tsonev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Scheduler
Asked by
Chris Trina
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Roffe
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or