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

Binding resources to appointments with SchedulerBindingDataSource

3 Answers 129 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Applicators
Top achievements
Rank 2
Applicators asked on 02 Mar 2010, 08:54 AM
Hi,

I have been experiencing some problems with binding appointments to resources.

I have some "Orders" that is just a Appointment and some resources thats Cars that have the appointments attached.

Im using a SchedulerBindingSource With this code:

            SchedulerBindingDataSource schedulerBindingDataSource1 = new SchedulerBindingDataSource(); 
 
            AppointmentMappingInfo appointmentMappingInfo = new AppointmentMappingInfo(); 
            appointmentMappingInfo.Start = "Start"
            appointmentMappingInfo.End = "End"
            appointmentMappingInfo.Summary = "Summary"
            appointmentMappingInfo.Description = "Description"
            appointmentMappingInfo.Location = "Location"
            appointmentMappingInfo.UniqueId = "Id"
            appointmentMappingInfo.BackgroundId = "BackGroundID"
            appointmentMappingInfo.StatusId = "StatusCarOn"
            appointmentMappingInfo.ResourceId = "Carid"
            appointmentMappingInfo.Resources = ""
 
            SchedulerMapping idMapping = appointmentMappingInfo.FindByDataSourceProperty("Id"); 
            idMapping.ConvertToDataSource = ConvertIdToDataSource; 
            idMapping.ConvertToScheduler = ConvertIdToScheduler; 
 
            SchedulerMapping idMapping2 = appointmentMappingInfo.FindByDataSourceProperty("Carid"); 
            idMapping2.ConvertToDataSource = ConvertIdToDataSourceForCars; 
            idMapping2.ConvertToScheduler = ConvertIdToScheduler; 
 
            schedulerBindingDataSource1.EventProvider.Mapping = appointmentMappingInfo; 
            schedulerBindingDataSource1.EventProvider.DataSource = _orderExtendScheduleItems; 
 
            ResourceMappingInfo resourceMappingInfo = new ResourceMappingInfo(); 
            resourceMappingInfo.Id = "Carid"
            resourceMappingInfo.Name = "Carname"
 
            SchedulerMapping ridMapping = resourceMappingInfo.FindBySchedulerProperty("Id"); 
            ridMapping.ConvertToDataSource = ConvertIdToDataSource2; 
            ridMapping.ConvertToScheduler = ConvertIdToScheduler; 
 
            schedulerBindingDataSource1.ResourceProvider.Mapping = resourceMappingInfo; 
            schedulerBindingDataSource1.ResourceProvider.DataSource = carList; 
 
            radScheduler1.DataSource = schedulerBindingDataSource1; 

But for some reason the appointments wont get binded to the "Cars" / Resources...

Anyone know how to do this?

3 Answers, 1 is accepted

Sort by
0
Dobry Zranchev
Telerik team
answered on 03 Mar 2010, 07:53 AM
Hi,

Thank you for contacting us. Unfortunately, I cannot answer this question without receiving more information. The code looks OK at first look. Could you provide us a sample application in order to give more appropriate help.

Sincerely yours,
Dobry Zranchev
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.
0
Applicators
Top achievements
Rank 2
answered on 03 Mar 2010, 09:01 AM
I think I have solved it my self, by addind a list of Resources ( List<Resource> ) to the Orders Class and then adding:

            appointmentMappingInfo.ResourceId = "Id";  
            appointmentMappingInfo.Resources = "Resources";  

Ill try to make a sample, but for now this is working for me.
0
Dobry Zranchev
Telerik team
answered on 04 Mar 2010, 08:34 AM
Hello IT2TAL,

I am happy that you found a solution. By the way, if you do not have a collection but just a database, the property of mapping is exactly the name of the relation between the Appointments data table and Resources data table.

Do not hesitate to contact us if you have additional questions.

Sincerely yours,
Dobry Zranchev
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 and Reminder
Asked by
Applicators
Top achievements
Rank 2
Answers by
Dobry Zranchev
Telerik team
Applicators
Top achievements
Rank 2
Share this question
or