I'm trying to render appointments in the scheduleview but only entire days are rendered as shown in attachment.
I'm using the Scheduleview like this
<
telerik:RadScheduleView
x:Name
=
"MainSchedule"
Grid.Column
=
"1"
Margin
=
"2"
NavigationHeaderVisibility
=
"Collapsed"
AppointmentsSource
=
"{Binding Appointments}"
ResourceTypesSource
=
"{Binding ResourceTypes}"
SelectedAppointment
=
"{Binding SelectedAppointment, Mode=TwoWay}"
MouseDoubleClick
=
"MainSchedule_MouseDoubleClick"
CurrentDate
=
"{Binding DateStart}"
GroupHeaderContentTemplateSelector
=
"{StaticResource GroupSelector}"
AppointmentItemContentTemplate
=
"{StaticResource AppointmentTemplate}"
>
<
telerik:RadScheduleView.GroupDescriptionsSource
>
<
scheduleView:GroupDescriptionCollection
>
<
scheduleView:ResourceGroupDescription
ResourceType
=
"Staff"
/>
</
scheduleView:GroupDescriptionCollection
>
</
telerik:RadScheduleView.GroupDescriptionsSource
>
<
telerik:RadScheduleView.ViewDefinitions
>
<
telerik:TimelineViewDefinition
TimerulerGroupStringFormat
=
"{}{0:dd MMM}"
TimerulerMajorTickStringFormat
=
"{}{0:HH}"
TimerulerMinorTickStringFormat
=
"{}{0:HH}"
/>
</
telerik:RadScheduleView.ViewDefinitions
>
</
telerik:RadScheduleView
>
private
void
LoadHolidays()
{
if
(_holidayResource !=
null
)
{
Appointments.Clear();
var holidays = _dataService.GetManager().TblDatStaffTime.Where(st => st.TblLstActivity.ActivityType ==
"Holiday"
&& st.RealStart >=
this
.CurrentView.MainSchedule.CurrentDate.FirstDayOfMonth() &&
st.RealEnd <
this
.CurrentView.MainSchedule.CurrentDate.LastDayOfMonth()).Execute();
foreach
(TblDatStaffTime item
in
holidays)
{
var appt =
new
HolidayAppointment(item);
if
(_holidayResource.Where(c => c.Key == item.StaffID.ToString()).Count() > 0)
{
appt.Resources.Add(_holidayResource[item.StaffID.ToString()]);
this
.Appointments.Add(appt);
}
}
var countApp =
this
.CurrentView.MainSchedule.AppointmentsSource;
}
}
public
class
HolidayAppointment : Appointment
{
private
bool
isReadOnly;
public
TblDatStaffTime Holiday {
get
;
set
; }
public
HolidayAppointment(TblDatStaffTime holiday)
{
this
.Holiday = holiday;
}
public
bool
IsReadOnly
{
get
{
return
this
.Storage<HolidayAppointment>().isReadOnly; }
set
{
var storage =
this
.Storage<HolidayAppointment>();
if
(storage.isReadOnly != value)
{
storage.isReadOnly = value;
this
.OnPropertyChanged(() =>
this
.IsReadOnly);
}
}
}
public
override
string
Subject
{
get
{
return
Holiday.TblLstActivity.ShortName; }
}
public
SolidColorBrush HolidayBrush
{
get
{
return
new
SolidColorBrush(StringExtensions.HexStringToColor(Holiday.TblLstActivity.Color)); }
}
public
override
DateTime Start
{
get
{
return
this
.Holiday.RealStart; }
set
{
base
.Start =
this
.Holiday.RealStart;
this
.OnPropertyChanged(() =>
this
.Start);
}
}
public
override
DateTime End
{
get
{
return
this
.Holiday.RealEnd; }
set
{
base
.End =
this
.Holiday.RealEnd;
this
.OnPropertyChanged(() =>
this
.End);
}
}
private
string
GetTranslation()
{
string
result =
string
.Empty;
switch
(IdentityCSD.Language)
{
case
IdentityCSD.Languages.EN:
result = Holiday.TblLstActivity.DescEN;
break
;
case
IdentityCSD.Languages.NL:
result = Holiday.TblLstActivity.DescNL;
break
;
case
IdentityCSD.Languages.FR:
result = Holiday.TblLstActivity.DescFR;
break
;
case
IdentityCSD.Languages.GE:
result = Holiday.TblLstActivity.DescGE;
break
;
default
:
result = Holiday.TblLstActivity.DescLC;
break
;
}
return
result;
}
}
So that appoinments that are showing are 24 hours long. And those which are not showing are less. Anyone got a solution for this ?