ArrayListDataProvider scheduleProvider;
scheduleProvider = new SimpleArrayListProvider();
scheduleProvider.MasterList =SimpleArrayListProvider.InitializeRandomData();
this.scheduleControl1.DataSource = scheduleProvider;
//Default value is true.
this.scheduleControl1.ShowMultiDayAppointmentsAsSpans =true;
|
Hi,
Actually, I want to resize appointment to span multiple days using mouse.
Thanks,
Mohit
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;
} |