Scheduleview not rending appointments under 24 hours

4 posts, 0 answers
  1. CreoniX
    CreoniX avatar
    28 posts
    Member since:
    Sep 2009

    Posted 28 Dec 2015 Link to this post

    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 ?

  2. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 29 Dec 2015 Link to this post

    Hi Marnix,

    Using the provided description and code - snippets we tried to reproduce the observed by you behavior of the appointments on our side but it seems everything is working as expected - please, check the attached video and let us know if we didn't miss something.

    Could you please, try to isolate the observed behavior in a sample project and send it to us - thus we could be able to continue our investigation and provide you with a prompt solution?

    We are looking forward to hearing from you.

    Regards,
    Nasko
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. CreoniX
    CreoniX avatar
    28 posts
    Member since:
    Sep 2009

    Posted 29 Dec 2015 Link to this post

    Could attacht the sample project shown in the video ?
  5. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 29 Dec 2015 Link to this post

    Hi Marnix,

    Attached you could find the sample project we used for our investigation. It would be great if you could modify it in order to reproduce your issue or provide us some guidance what modification we need to do on our side in order to reproduce it.

    Hope this helps.

    Regards,
    Nasko
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top