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

[Solved] Copying of appointments, and missing resources on the server side

5 Answers 113 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Stefan Stanescu
Top achievements
Rank 1
Stefan Stanescu asked on 23 Nov 2009, 01:19 PM
Hi everybody!

What I need to do is to be able to copy an appointment in the scheduler, using drag and drop.

I've created a very simple JS function to do that. It should make a copy of the dragged appointment and insert it in the scheduler, and by not calling the eventArgs.set_cancel(true) the initial appointment would be updated to the new timeslot:

function RadScheduler_ClientAppointmentMoveEnd(sender, args) { 
        var Appointment = args.get_appointment(); 
        sender.insertAppointment(Appointment); 
    } 

The problem is that the resources of the appointment are not sent together with the appointment back to the server, and when I'm trying to access a resource in my custom provider:

public override void Insert(RadScheduler owner, Appointment appointmentToInsert) 
//some other code here 
int TaskID = (int)appointmentToInsert.Resources.GetResourceByType("Task").Key; 

I'm getting a NullReferenceException.

On the client side I've checked the properties of the appointment before inserting it and it does indeed hold the resources.
On the server however, the resources seem to disapperar, although the other properties are sent correctly.

How should I solve this problem?

Thanks,
Stefan


5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 26 Nov 2009, 09:22 AM
Hello Stefan,

We tested this scenario locally, but there was no problem at our end. Please, see the attached demo for reference.

Greetings,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Stefan Stanescu
Top achievements
Rank 1
answered on 26 Nov 2009, 10:45 AM
Thanks for your reply Peter!

Unfortunately, it seems that I'm getting the same results with your code as well :(
The only reason I can think of is that I'm using an older version of the controls.
I guess I'll just have to upgrade then...

Best regards,
Stefan
0
Peter
Telerik team
answered on 26 Nov 2009, 12:52 PM
Hello Stefan,

Which version do you use? In this forum thread details you have specified version 2009.3 1103 which is the current official version. There shouldn't be a problem with this one.

All the best,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Stefan Stanescu
Top achievements
Rank 1
answered on 27 Nov 2009, 08:18 AM
Hi Peter,

I'm using the Q2 2008 release (shame on me).
So, I'm sorry if I posted in the wrong place, but to be honest, I don't know where I have specified the version in this forum thread...
Just to know in the future, if I'll still be using an older version where should I post my questions?

Many thanks,
Stefan
0
Peter
Telerik team
answered on 27 Nov 2009, 03:04 PM
Hello Stefan,

Actually, I owe you apologies. I found out that indeed there isn't a way to specify version details when starting a new forum thread. This feature is available only for tickets, but not for forum threads. What confused me was that our admin system automatically sets the version field to the current official version. I am sorry about that.

That said, if you want to let us know which version you are dealing with you should specify it directly in the post.


Best wishes,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Scheduler
Asked by
Stefan Stanescu
Top achievements
Rank 1
Answers by
Peter
Telerik team
Stefan Stanescu
Top achievements
Rank 1
Share this question
or