Binding resources to appointments with SchedulerBindingDataSource

4 posts, 0 answers
  1. Applicators
    Applicators avatar
    2 posts
    Member since:
    Oct 2008

    Posted 02 Mar 2010 Link to this post

    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?
  2. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    353 posts

    Posted 03 Mar 2010 Link to this post

    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.
  3. Applicators
    Applicators avatar
    2 posts
    Member since:
    Oct 2008

    Posted 03 Mar 2010 Link to this post

    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.
  4. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    353 posts

    Posted 04 Mar 2010 Link to this post

    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.
Back to Top