3 Answers, 1 is accepted
0
                                Hi Sergey,
RadScheduleView provides a way to scroll to certain appointment/resource using its ScrollIntoView method.
ScrollIntoView method can have one or two parameters, the first parameter should be appointment or slot, the second parameter is optional and defines whether the appointment/slot should be scrolled to the beginning of the view.
Such kind of animation of appointment/resource is not provided out of the box.
Kind regards,
Yana
the Telerik team
                                        RadScheduleView provides a way to scroll to certain appointment/resource using its ScrollIntoView method.
ScrollIntoView method can have one or two parameters, the first parameter should be appointment or slot, the second parameter is optional and defines whether the appointment/slot should be scrolled to the beginning of the view.
Such kind of animation of appointment/resource is not provided out of the box.
Kind regards,
Yana
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
                                
                                                    Véronique
                                                    
                                            
    Top achievements
    
            
                 Rank 1
                Rank 1
            
    
                                                
                                                answered on 25 Jul 2019, 07:40 PM
                                            
                                        Hello,
I would like to do the same animation ie highlight an appointment by programmation.
Is it still impossible or is there a way to do it ?
Thanks
Véronique
0
                                Hello Véronique,
In order to highlight a particular appointment, you can change the Background of a Border inside the ControlTemplate of the AppointmentItem. Note, that the border will be different depending on the state of the item (for example, if it is selected). This is due to the fact that there are different borders inside the ControlTemplate for the different visual states.
Additionally, since the ControlTemplate is different for older themes vs newer themes you will have to target a different Border element depending on which theme you are using. Here is some sample code demonstrating what I have in mind:
 
 
 
 
 
 
 
 
 
 
 
Please, give this approach a try and let me know how it goes.
Regards,
Vladimir Stoyanov
Progress Telerik
                                        In order to highlight a particular appointment, you can change the Background of a Border inside the ControlTemplate of the AppointmentItem. Note, that the border will be different depending on the state of the item (for example, if it is selected). This is due to the fact that there are different borders inside the ControlTemplate for the different visual states.
Additionally, since the ControlTemplate is different for older themes vs newer themes you will have to target a different Border element depending on which theme you are using. Here is some sample code demonstrating what I have in mind:
// Find the AppointmentItem visual element depending on the Subject of the appointment.
// this.ScheduleView refers to the RadScheduleView instance            var appointmentItem = this.ScheduleView.ChildrenOfType<AppointmentItem>().FirstOrDefault(app => (app.DataContext as AppointmentItemProxy).Subject == "First Appointment");            Border border;            Brush defaultBrush;            // Older themes approach            if (appointmentItem.IsSelected)            {                border = appointmentItem.ChildrenOfType<Border>().FirstOrDefault(b => b.Name == "CommonStatesVisual");                var innerBorder = border.ChildrenOfType<Border>().FirstOrDefault();                innerBorder.Background = Brushes.Red;                this.ReturnBrushToBorder(innerBorder, null);            }            else            {                defaultBrush = appointmentItem.Background;                appointmentItem.Background = Brushes.Red;                this.ReturnBrushToItem(appointmentItem, defaultBrush);            }            // Newer themes approach             //if (appointmentItem.IsSelected)            //{            //    border = appointmentItem.ChildrenOfType<Border>().FirstOrDefault(b => b.Name == "SelectionVisual");            //    defaultBrush = border.Background;            //    border.Background = Brushes.Red;            //    this.ReturnBrushToBorder(border, defaultBrush);            //}            //else            //{            //    defaultBrush = appointmentItem.Background;            //    appointmentItem.Background = Brushes.Red;            //    this.ReturnBrushToItem(appointmentItem, defaultBrush);            //} 	   public void ReturnBrushToBorder(Border border, Brush defaultBrush)        {            DispatcherTimer timer = new DispatcherTimer();            timer.Interval = TimeSpan.FromSeconds(1);            timer.Tick += (s, args) => { border.Background = defaultBrush; };            timer.Start();        }        public void ReturnBrushToItem(AppointmentItem item, Brush defaultBrush)        {            DispatcherTimer timer = new DispatcherTimer();            timer.Interval = TimeSpan.FromSeconds(1);            timer.Tick += (s, args) => { item.Background = defaultBrush; };            timer.Start();        }Please, give this approach a try and let me know how it goes.
Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
