This is a migrated thread and some comments may be shown as answers.

Multiple days Appointment disappears on day view

18 Answers 235 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Filipe
Top achievements
Rank 1
Filipe asked on 29 May 2012, 12:27 AM
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

18 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 30 May 2012, 11:34 PM
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>
0
Filipe
Top achievements
Rank 1
answered on 31 May 2012, 12:04 AM
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
0
Lancelot
Top achievements
Rank 1
answered on 31 May 2012, 12:33 AM
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>
0
Filipe
Top achievements
Rank 1
answered on 01 Jun 2012, 05:44 PM
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
0
Yana
Telerik team
answered on 06 Jun 2012, 11:12 AM
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 >>

0
Filipe
Top achievements
Rank 1
answered on 07 Jun 2012, 06:54 PM
Hello

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

Thanks
Filipe
0
Yana
Telerik team
answered on 08 Jun 2012, 01:41 PM
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 >>

0
Filipe
Top achievements
Rank 1
answered on 08 Jun 2012, 10:00 PM
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
0
Shimoli
Top achievements
Rank 1
answered on 10 Jul 2012, 11:49 AM
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
0
Filipe
Top achievements
Rank 1
answered on 10 Jul 2012, 03:41 PM
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











0
saw
Top achievements
Rank 1
answered on 14 Jan 2015, 12:01 PM
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?
0
saw
Top achievements
Rank 1
answered on 14 Jan 2015, 12:04 PM
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?
0
Kalin
Telerik team
answered on 15 Jan 2015, 01:31 PM
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.

 
0
saw
Top achievements
Rank 1
answered on 19 Jan 2015, 06:23 AM
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;
        }
0
Kalin
Telerik team
answered on 21 Jan 2015, 12:53 PM
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.

 
0
saw
Top achievements
Rank 1
answered on 22 Jan 2015, 04:49 AM
Hi Kalin,
Thank you very much. This is really helpful.
0
saw
Top achievements
Rank 1
answered on 28 Jan 2015, 05:15 AM
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 ?

0
Kalin
Telerik team
answered on 30 Jan 2015, 09:51 AM
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.

 
Tags
ScheduleView
Asked by
Filipe
Top achievements
Rank 1
Answers by
Lancelot
Top achievements
Rank 1
Filipe
Top achievements
Rank 1
Yana
Telerik team
Shimoli
Top achievements
Rank 1
saw
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or