We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Resize Appointments

Thread ID:

Created:

Updated:

Platform:

Replies:

131798 Jul 27,2017 10:58 AM Jun 5,2018 09:07 AM Windows Forms 5
loading
Tags: ScheduleControl
Mohit
Asked On July 27, 2017 10:58 AM

Hi,

How do we resize appointments to span multiple days? Could you please provide a sample application to explain the same.

Thanks,
Mohit Saxena

Mohanraj Gunasekaran [Syncfusion]
Replied On July 28, 2017 06:30 AM

Hi Mohit,   
   
Thanks for using Syncfusion product.   
   
In order to span the appointment for multi days, you can use the ArrayListDataProvider as a Datasource and use the ShowMultiDayAppointmentsAsSpans properties. Please refer to the below code example.   
   
Code example   
ArrayListDataProvider scheduleProvider;   
scheduleProvider = new SimpleArrayListProvider();   
scheduleProvider.MasterList =SimpleArrayListProvider.InitializeRandomData();   
this.scheduleControl1.DataSource = scheduleProvider;   
   
//Default value is true.   
this.scheduleControl1.ShowMultiDayAppointmentsAsSpans =true;   
   
 
  
 
 
Screenshot 
 
 
Sample link: ScheduleControl 
 
Please let us know if we misunderstood your scenario. 
 
Regards, 
Mohanraj G 
 


Mohit
Replied On July 28, 2017 06:40 AM

Hi,

Actually, I want to resize appointment to span multiple days using mouse.


Thanks,

Mohit



Mohanraj Gunasekaran [Syncfusion]
Replied On July 31, 2017 07:31 AM

Hi Mohit,  
 
Thanks for using Syncfusion product.  
 
Currently, ScheduleControl does not have the Resizing support for appointments. So, we have logged the feature report for this. It will be available on any of our upcoming release.  
 
Regards,  
Mohanraj G  


Carlos
Replied On June 4, 2018 11:18 AM

Hi:

I'm using the schedule control in windows forms and I have been able to verify that when there are several multi days appointments in a month, it only shows one of these appointments. I am using version 16.1.0.37 of this control.
Could you please provide a sample application that works? The example above does not work.

Thanks


Sindhu Nagarajan [Syncfusion]
Replied On June 5, 2018 09:07 AM

Hi Carlos, 
 
Sorry for the inconvenience caused. 
 
If you want to add an appointment for multi days, you can use SimpleScheduleDataProvider as datasource to the schedule control. We have prepared a simple sample as per your requirement. In the sample,  GetSchedule() method is overridden. By overriding the method, the appointment will be generated individually  for the days from StartDate to the End Date. Please refer to the below code and sample, 
 
Code Example 
public override IScheduleAppointmentList GetSchedule(System.DateTime startDate, System.DateTime endDate) 
{ 
     ScheduleAppointmentList list = new ScheduleAppointmentList(); 
     System.DateTime start = startDate.Date; 
     System.DateTime end = endDate.Date; 
 
     if (ScheduleList != null && ScheduleList.Count > 0) 
     { 
         return list; 
     } 
 
     foreach (ScheduleAppointment item in this.MasterList) 
     { 
         if ((item.StartTime.Date >= start && item.StartTime.Date <= end) || (item.EndTime.AddMinutes(-1).Date > start && item.EndTime.Date <= end)) 
         { 
             if (item.StartTime < item.EndTime) 
             { 
                 int count = ((TimeSpan)(item.EndTime.Date - item.StartTime.Date)).Days + 1; 
                 System.DateTime meanDate = DateTime.Now; 
                 System.DateTime meanStartDate = DateTime.Now; 
                 System.DateTime tempEndTime = DateTime.Now; 
                 bool intialized = true; 
 
                 for (int i = 0; i < count; i++) 
                 { 
                     IScheduleAppointment item1 = item.Clone() as IScheduleAppointment; 
                     if (intialized) 
                     { 
                         meanStartDate = item.StartTime; 
                         meanDate = item.EndTime.Date; 
                         tempEndTime = item.EndTime; 
                         intialized = false; 
                     } 
                     else 
                     { 
                         item1.StartTime = meanStartDate.AddDays(i).Date; 
                     } 
                     if (item.StartTime.Date < meanDate) 
                     { 
                         item1.EndTime = item1.StartTime.Date; 
                     } 
                     else if (item.StartTime.Date.Equals(meanDate)) 
                     { 
                         item1.EndTime = tempEndTime; 
                     } 
                     list.Add(item1); 
                 } 
             } 
             else 
             { 
                 list.Add(item); 
             } 
         } 
     } 
     list.SortStartTime(); 
     ScheduleList = list; 
     return list; 
} 
 
Screenshot 
 
 
Sample Link: ScheduleControl 
 
Please let us know if you have any other queries. 
 
Regards, 
Sindhu  


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;