Multiple days Appointment disappears on day view

19 posts, 0 answers
  1. Filipe
    Filipe avatar
    16 posts
    Member since:
    Jun 2011

    Posted 28 May 2012 Link to this post

    Hello.

    I saw your samples and this bug does not seem to happen.

    But in my project I created a appointment with start date in 28/05/2012 and the end date in 31/05/2012. This appointment appears in the week view but it doesn't appear on the day view.
    I have the all day area active but when I change from the week to the day view the appointment appears and then disappears. That is very strange.

    Here is the code of the scheduler view user control:
    <telerik:RadScheduleView x:Name="SchedulerView1" telerik:StyleManager.Theme="Metro" HorizontalScrollBarVisibility="Visible"
                                      VerticalScrollBarVisibility="Visible" VerticalAlignment="Top"
                                       CurrentDate="{Binding ScheduleSelectedDate, Mode=TwoWay}" SnapAppointments="True"
                                           ShowCurrentTimeIndicator="True"
                                       AppointmentsSource="{Binding Appointments}"   FirstDayOfWeek="Monday" VerticalOffset="300"
                                        FontSize="10" FontFamily="Verdana"  ActiveViewDefinitionIndex="1"
                                      TimeRulerItemTemplate="{StaticResource TimeRulerItemDataTemplate}"
                                      GroupHeaderContentTemplate="{StaticResource GroupHeaderDataTemplate}"
                                      TimeMarkersSource="{Binding TimeMarkerCollection}"
                                      CategoriesSource="{Binding CategoriesCollection}"
                                      ResourceTypesSource="{Binding ResourceTypesCollection, Mode=TwoWay}"
                                      EditAppointmentDialogStyle="{StaticResource EditAppointmentDialogStyle}"
                                      SelectedAppointment="{Binding SelectedAppointmentBinding, Mode=TwoWay}"
                                      AppointmentDeleted="scheduleView_AppointmentDeleted"
                                      AppointmentEdited="scheduleView_AppointmentEdited"
                                      AppointmentCreated="scheduleView_AppointmentCreated" AppointmentCreating="SchedulerView1_AppointmentCreating"
                                           ToolTipTemplate="{StaticResource AppointmentToolTipTemplate}"
                                           VisibleRangeChangedCommand="{Binding VisibleRangeChanged}"
                                      VisibleRangeChangedCommandParameter="{Binding VisibleRange, RelativeSource={RelativeSource Self}}"
                                           AppointmentEditing="SchedulerView1_AppointmentEditing"
                                           AppointmentItemContentTemplate="{StaticResource AppointmentTemplate}">
     
                      <telerik:RadScheduleView.DragDropBehavior>
                          <common:ScheduleViewDragDropBehavior />
                      </telerik:RadScheduleView.DragDropBehavior>
     
     
     
                      <telerik:RadScheduleView.ViewDefinitions >
                          <telerik:DayViewDefinition TimerulerMajorTickStringFormat="{}{0:HH}:{0:mm}"
                          GroupHeaderDateStringFormat="{}{0:dddd (dd-MM)}" ShowAllDayArea = "True"
                          MajorTickLength="1h" MinorTickLength="30min" MinTimeRulerExtent="800"
                          AppointmentFilter="{Binding AppoitmentsFilter}" EnableSmallAppointmentRendering="True"/>
                           
                          <telerik:WeekViewDefinition TimerulerMajorTickStringFormat="{}{0:HH}:{0:mm}"
                          GroupHeaderDateStringFormat="{}{0:dddd (dd-MM)}" ShowAllDayArea = "True"
                          MajorTickLength="1h" MinorTickLength="30min" MinTimeRulerExtent="800"
                          AppointmentFilter="{Binding AppoitmentsFilter}" EnableSmallAppointmentRendering="True"/>
                          <telerik:MonthViewDefinition AppointmentFilter="{Binding AppoitmentsFilter}"/>
                      </telerik:RadScheduleView.ViewDefinitions>
                  </telerik:RadScheduleView>

    Can you help me?

    Thanks.
    Filipe

  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 30 May 2012 Link to this post

    Hi Filipe,

    i notice in your ViewDefinitions you have Appointment spelled incorrectly. Replace your ViewDefinition code with this.

        <telerik:RadScheduleView.ViewDefinitions >
     
            <telerik:DayViewDefinition TimerulerMajorTickStringFormat="{}{0:HH}:{0:mm}"
     
            GroupHeaderDateStringFormat="{}{0:dddd (dd-MM)}" ShowAllDayArea = "True"
     
            MajorTickLength="1h" MinorTickLength="30min" MinTimeRulerExtent="800"
     
            AppointmentFilter="{Binding AppointmentFilter}" EnableSmallAppointmentRendering="True"/>
     
              
     
            <telerik:WeekViewDefinition TimerulerMajorTickStringFormat="{}{0:HH}:{0:mm}"
     
            GroupHeaderDateStringFormat="{}{0:dddd (dd-MM)}" ShowAllDayArea = "True"
     
            MajorTickLength="1h" MinorTickLength="30min" MinTimeRulerExtent="800"
     
            AppointmentFilter="{Binding AppointmentFilter}" EnableSmallAppointmentRendering="True"/>
     
            <telerik:MonthViewDefinition AppointmentFilter="{Binding AppointmentFilter}"/>
     
        </telerik:RadScheduleView.ViewDefinitions>
     
    </telerik:RadScheduleView>
  3. DevCraft banner
  4. Filipe
    Filipe avatar
    16 posts
    Member since:
    Jun 2011

    Posted 30 May 2012 Link to this post

    Hello.

    No,  that is not a error. I copied from your Appointment Filtering Sample and in your sample is also like that. But it works fine the filtering.

    The problem is only with multiple days appointments on the dayview. They have a strange behavior. For a fraction of a second they appear and disappear. 

    Appointments with the flag isallday active , are working fine and the appointment goes to the allday area.

    Now, my code is like this:
    <telerik:RadScheduleView x:Name="SchedulerView1" telerik:StyleManager.Theme="Metro" HorizontalScrollBarVisibility="Visible"
                                       VerticalScrollBarVisibility="Visible" VerticalAlignment="Top"
                                        CurrentDate="{Binding ScheduleSelectedDate, Mode=TwoWay}" SnapAppointments="True"
                                            ShowCurrentTimeIndicator="True"
                                        AppointmentsSource="{Binding Appointments}"   FirstDayOfWeek="Monday" VerticalOffset="300"
                                         FontSize="10" FontFamily="Verdana"  ActiveViewDefinitionIndex="1"
                                       TimeRulerItemTemplate="{StaticResource TimeRulerItemDataTemplate}"
                                        
                                       GroupHeaderContentTemplateSelector="{StaticResource GroupHeaderTemplateSelector}"
                                       TimeMarkersSource="{Binding TimeMarkerCollection}"
                                       CategoriesSource="{Binding CategoriesCollection}"
                                       ResourceTypesSource="{Binding ResourceTypesCollection, Mode=TwoWay}"
                                       EditAppointmentDialogStyle="{StaticResource EditAppointmentDialogStyle}"
                                       SelectedAppointment="{Binding SelectedAppointmentBinding, Mode=TwoWay}"
                                       AppointmentDeleted="scheduleView_AppointmentDeleted"
                                       AppointmentEdited="scheduleView_AppointmentEdited"
                                       AppointmentCreated="scheduleView_AppointmentCreated" AppointmentCreating="SchedulerView1_AppointmentCreating"
                                            ToolTipTemplate="{StaticResource AppointmentToolTipTemplate}"
                                            VisibleRangeChangedCommand="{Binding VisibleRangeChanged}"
                                       VisibleRangeChangedCommandParameter="{Binding VisibleRange, RelativeSource={RelativeSource Self}}"
                                            AppointmentEditing="SchedulerView1_AppointmentEditing"
                                            AppointmentItemContentTemplate="{StaticResource AppointmentTemplate}">
     
                       <telerik:RadScheduleView.DragDropBehavior>
                           <common:ScheduleViewDragDropBehavior />
                       </telerik:RadScheduleView.DragDropBehavior>
     
     
     
                       <telerik:RadScheduleView.ViewDefinitions >
                           <telerik:DayViewDefinition TimerulerMajorTickStringFormat="{}{0:HH}:{0:mm}"
                           GroupHeaderDateStringFormat="{}{0:dddd (dd-MM)}" ShowAllDayArea = "True"
                           MajorTickLength="1h" MinorTickLength="30min" MinTimeRulerExtent="800" Orientation="Vertical"
                           AppointmentFilter="{Binding AppointmentsFilter}" EnableSmallAppointmentRendering="True"/>
                            
                           <telerik:WeekViewDefinition TimerulerMajorTickStringFormat="{}{0:HH}:{0:mm}"
                           GroupHeaderDateStringFormat="{}{0:dddd (dd-MM)}" ShowAllDayArea = "True" Orientation="Vertical"
                           MajorTickLength="1h" MinorTickLength="30min" MinTimeRulerExtent="800"
                           AppointmentFilter="{Binding AppointmentsFilter}" EnableSmallAppointmentRendering="True"
                                                       WeekGroupHeaderStringFormat="Semana {0}, {1:MM yyyy}">
                                
                           </telerik:WeekViewDefinition>
                           <telerik:MonthViewDefinition AppointmentFilter="{Binding AppointmentsFilter}"/>
                       </telerik:RadScheduleView.ViewDefinitions>
                   </telerik:RadScheduleView>

    Thanks

    Filipe
  5. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 30 May 2012 Link to this post

    Hi Filipe,

    I used your direct template and came up with this solution. Replace your ViewDefinition code with this and let me know if it solves your problem. It works on my end.

    <scheduleView:RadScheduleView.ViewDefinitions>
                    <scheduleView:DayViewDefinition TimerulerMajorTickStringFormat="{}{0:HH}:{0:mm}"
                           GroupHeaderDateStringFormat="{}{0:dddd (dd-MM)}" ShowAllDayArea = "True"
                           MajorTickLength="1h" MinorTickLength="30min" MinTimeRulerExtent="800" Orientation="Vertical"
                           AppointmentFilter="{Binding AppointmentsFilter}" EnableSmallAppointmentRendering="True"/>
     
                    <scheduleView:WeekViewDefinition TimerulerMajorTickStringFormat="{}{0:HH}:{0:mm}"
                           GroupHeaderDateStringFormat="{}{0:dddd (dd-MM)}" ShowAllDayArea = "True" Orientation="Vertical"
                           MajorTickLength="1h" MinorTickLength="30min" MinTimeRulerExtent="800"
                           AppointmentFilter="{Binding AppointmentsFilter}" EnableSmallAppointmentRendering="True"
                                                       WeekGroupHeaderStringFormat="Semana {0}, {1:MM yyyy}" />
                     
     
                         
                    <scheduleView:MonthViewDefinition AppointmentFilter="{Binding AppoitmentsFilter}" />
                             
                    <scheduleView:TimelineViewDefinition AppointmentFilter="{Binding AppoitmentsFilter}" MinTimeRulerExtent="16800" />
                </scheduleView:RadScheduleView.ViewDefinitions>
  6. Filipe
    Filipe avatar
    16 posts
    Member since:
    Jun 2011

    Posted 01 Jun 2012 Link to this post

    Hello

    The code you sent is pratically the same I had. The only difference I saw was the timeline view that I didn't have.

    I copied your code, and it had the same behavior.
    The multiple day appointment still doesn't appear on the dayview definition.

    Filipe
  7. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 06 Jun 2012 Link to this post

    Hello Fillipe,

    We've tested the provided code but were not able to reproduce the issue as well.  Can you please send us a short video showing the exact steps (you can use Jing)?  You should either open a support ticket and attach it there or upload it to an external server and send us the link.

    Thanks in advance

    Regards,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  8. Filipe
    Filipe avatar
    16 posts
    Member since:
    Jun 2011

    Posted 07 Jun 2012 Link to this post

    Hello

    I made the video with the help of jing as you suggested. The link is http://screencast.com/t/bvu77wvJNRpD .

    Thanks
    Filipe
  9. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 08 Jun 2012 Link to this post

    Hi Filipe,

    Thank you for sending the video.

    I've tried to reproduced it but still without much success. It seems that you've made some cusomizations to the ScheduleView. so it will be best if you send us a simple runnable project reproducing the problem. Please open a support ticket and attach it there.

    Thanks in advance.

    All the best,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  10. Filipe
    Filipe avatar
    16 posts
    Member since:
    Jun 2011

    Posted 08 Jun 2012 Link to this post

    Hello

    Problem solved.

    I was using Visible Range to get the Appointments from the database, but I didn't notice that on the day view, the range is just that day. So the appointment was out of that range because I was using Appointment StartDate >= VisibleRange Start and Appointment EndDate <= VisibleRange End. That obviously doesn't bring the multiple day appointment.
    After all it was easy to solve, and maybe because it was easy, I didn't checked right from the start.

    Sorry for wasting your time.

    Thanks for your commitment helping me.

    You can close this issue.

    Filipe
  11. Shimoli
    Shimoli avatar
    16 posts
    Member since:
    May 2011

    Posted 10 Jul 2012 Link to this post

    Hi Filipe,
    Can you guide me how did you solve your issue?

    I am getting same issue but I have nothing to identify whether date range is correct or not. As per shown in below code, I can restrict wrong appointment generation.But problem is that this.ActiveViewDefinitionIndex is going to change after multiple times event fire .So again code will not work properly for me.

     private void OnVisibleRangeChanged(object arg)
            {
                if (!DesignerProperties.IsInDesignTool)
                {
                    DateSpan rangeValue = ((DateSpan)(arg));
                    if (rangeValue != null)
                    {
                        short days = (short)(rangeValue.End - rangeValue.Start).TotalDays;
                        if (this.ActiveViewDefinitionIndex == WEEK_VIEW_INDEX && days!=7)
                        {
                            return;
                        }
                        if (this.ActiveViewDefinitionIndex == DAY_VIEW_INDEX && days != 1)
                        {
                            return;
                        }
                       if (this.ActiveViewDefinitionIndex == MONTH_VIEW_INDEX && days < 27)// for Leap year
                        {
                            return;
                        }
                        this.GenerateAppointments(arg as DateSpan);
                    }
                }
            }
    Please help me out for the same.

    Thanks in Advance,
    Shimoli Shah
  12. Filipe
    Filipe avatar
    16 posts
    Member since:
    Jun 2011

    Posted 10 Jul 2012 Link to this post

    Hello Shimoli.

    In the xaml, i have this code on the RadSchedulerView properties:
    VisibleRangeChangedCommand="{Binding VisibleRangeChanged}"
    VisibleRangeChangedCommandParameter="{Binding VisibleRange, RelativeSource={RelativeSource Self}}"


    In the view model i have this:

            public ICommand VisibleRangeChanged
            {
                get
                {
                    return this.visibleRangeChanged;
                }
                set
                {
                    this.visibleRangeChanged = value;
                }
            }
     
     
    public void defineCommands()
            {
     
                this.VisibleRangeChanged = new Telerik.Windows.Controls.DelegateCommand(this.OnVisibleRangeExecuted, this.OnVisibleRangeCanExecute);
    }
     
     private void OnVisibleRangeExecuted(object param)
            {
                // The param is bound to the VisibleRange property in XAML
                //
     
                IDateSpan _dateSpan = param as IDateSpan;
     
            
             GetActivitySchedulesFromDateSpanAsync(_dateSpan);
                    
                
            }


    The GetActivityScheduleFromDateSpanAsync is a call to my WCF.

    This function in the server side, goes to the database and gets the appointments between start and end date. My problem was on the conditions of the start and end dates of the appointment.

    I was using   StartTime >= _dateSpan.Start  && EndTime <= _dateSpan.End. 

    That was incorrect. A multiple day appointment may have a start time inferior to the start of the day selected and could have a end time superior to the end of the day selected in the scheduler.

    So i changed the conditions so that I could catch all the appointments that had that day inside the period or that were inside that day. The new conditions were :

    ((s.StartTime <= _dateSpan.Start 

    && s.EndTime >= _dateSpan.End && s.EndTime >= _dateSpan.Start  )

    || (s.StartTime >= _dateSpan.Start 

    && s.EndTime <= _dateSpan.End)

    || (s.StartTime >= _dateSpan.Start 

    && s.EndTime >= _dateSpan.End && s.StartTime <= _dateSpan.End)

    || (s.StartTime <= _dateSpan.Start  && s.EndTime >= _dateSpan.End)

    || (s.StartTime <= _dateSpan.Start  && s.EndTime <= _dateSpan.End  && s.EndTime >= _dateSpan.Start  ))



    I hope this helps !

    Filipe











  13. saw
    saw avatar
    29 posts
    Member since:
    Jun 2014

    Posted 14 Jan 2015 in reply to Filipe Link to this post

    Hi,

    This may not relate to this question, but this also regarding multiple days.
    I want to display specific days in RadScheduleView. Like;
    1st January, 5th January, 8 January (01/01/2015 .....) 
    I gather SelectedDates from RadCalendar. I have 
    <telerik:DayViewDefinition Title="Multi Days"/>
    for this. And i can access it using
    radScheduleDetails.ViewDefinitions[4]

    Any workaround for achieve specific multiple day in  RadScheduleView?
  14. saw
    saw avatar
    29 posts
    Member since:
    Jun 2014

    Posted 14 Jan 2015 Link to this post

    Hi,

    This may not relate to this question, but this also regarding multiple days.
    I want to display specific days in RadScheduleView. Like;
    1st January, 5th January, 8 January (01/01/2015 .....) 
    I gather SelectedDates from RadCalendar.
    I have
    <telerik:DayViewDefinition Title="Multi Days"/>
    for display dates and i can show date range (1,2,3 of January). And i can access it using 
    radScheduleDetails.ViewDefinitions[4]

    Any workaround for achieve specific multiple days in  RadScheduleView?
  15. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 15 Jan 2015 Link to this post

    Hello,

    You can use GroupFilter in order to show only the required days. For sample implementation please check the following demo from our online Silverlight demos:
    http://demos.telerik.com/silverlight/#ScheduleView/Grouping/Filtering

    Hope this helps.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  16. saw
    saw avatar
    29 posts
    Member since:
    Jun 2014

    Posted 19 Jan 2015 Link to this post

    Hi Kalin,
    Could you please give me little example ? still i wasn't able to achieve this.
    I just need a workaround for this group filter, Group filter binding done as example. below view model method call using Rad calendar selection change event.
    public void UpdateSelectedDates()
           {
               SelectedDateFilter = new Func<object, bool>(SelectedDatesFilterFunc);
           }
      and below is my Selected dates function
    private bool SelectedDatesFilterFunc(object selectedDates)
            {          
             if (selectedDates is DateTime)
                  {                 
          return ((DateTime)selectedDates).Day == SelectedDates[SelectedDates.Count-1].Day;             
                  }
                 
                // }
                return true;
            }
  17. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 21 Jan 2015 Link to this post

    Hi,

    Please find attached a sample project demonstrating how to use implement such a scenario.

    Hope this helps.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  18. saw
    saw avatar
    29 posts
    Member since:
    Jun 2014

    Posted 21 Jan 2015 in reply to Kalin Link to this post

    Hi Kalin,
    Thank you very much. This is really helpful.
  19. saw
    saw avatar
    29 posts
    Member since:
    Jun 2014

    Posted 27 Jan 2015 Link to this post

    Hi,
    This question also related to previous one. I want to select dates backward and show them on scheduler (Ex: 14th Jan, 10th Jan, 5th Jan). In my "Calendars_OnSelectionChanged" event I set, 
    radScheduleDetails.CurrentDate = Calendars.SelectedDates[0];
    If i didn't set this "GroupHeaderDate" will not display.
    My view definition for this multiple day select is,
    <telerik:WeekViewDefinition Title="Multi Days"
                                                GroupFilter="{Binding SelectedDateFilter}"
                                                VisibleDays="365"
                                                GroupHeaderDateStringFormat="{}{0:dddd(MM/dd/yyyy)}"
                                                />

    How can i achieve backward day selection ?

  20. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 30 Jan 2015 Link to this post

    Hello Saw,

    Try setting the CurrentDate property of the ScheduleView to first of January 2015. This way you will be see the whole year ahead.

    Hope this helps.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner