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

How to show description on Appointment List

2 Answers 176 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
ALEX
Top achievements
Rank 1
ALEX asked on 02 Jul 2017, 02:03 PM

Hi,

I'm using "RadControls for WinForms Q3 2011 SP1" internal build "2011.3.11.1219". I would like to show the description on appointment list. I was added the description on appointment buy it not appear on list. It always showing "Location" instead of "Description". I try to change the "AppointmentTitleFormat" but there has no way to show the description. I am testing it on Demo Radschedule\Group. How can i show the description at appointment?

Here is demo sample code from telerik.

 

protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
             
            DateTime baseDate = DateTime.Today;
            DateTime[] start = new DateTime[] { baseDate.AddHours(14.0), baseDate.AddDays(1.0).AddHours(9.0), baseDate.AddDays(2.0).AddHours(13.0) };
            DateTime[] end = new DateTime[] { baseDate.AddHours(16.0), baseDate.AddDays(1.0).AddHours(15.0), baseDate.AddDays(2.0).AddHours(17.0) };
            string[] summaries = new string[] { "Mr. Brown", "Mr. White", "Mrs. Green" };
            string[] descriptions = new string[] { "desc1", "desc 2", "desc3" }; // this is i added
            string[] locations = new string[] { "City", "Out of town", "Service Center" };
            AppointmentBackground[] backgrounds = new AppointmentBackground[] { AppointmentBackground.Business, AppointmentBackground.MustAttend, AppointmentBackground.Personal };
 
            this.radSchedulerDemo.Appointments.BeginUpdate();
            //radSchedulerDemo.AppointmentTitleFormat = "{0} to {1}<br>, {2} ({3}) {4} {5}";
 
            Appointment appointment = null;
             
 
            appointment = new Appointment(baseDate.AddHours(11.0), baseDate.AddHours(12.0), "summary", "description", "Garage");
            appointment.RecurrenceRule = new DailyRecurrenceRule(baseDate.AddHours(11.0), 2);
            this.radSchedulerDemo.Appointments.Add(appointment);
            this.radSchedulerDemo.Appointments.EndUpdate();
                  
            Color[] colors = new Color[]{Color.LightBlue, Color.LightGreen, Color.LightYellow,
                Color.Red, Color.Orange, Color.Pink, Color.Purple, Color.Peru, Color.PowderBlue};
 
            string[] names = new string[]{"Alan Smith", "Anne Dodsworth",
                "Boyan Mastoni", "Richard Duncan", "Maria Shnaider"};
 
            for (int i = 0; i < names.Length; i++)
            {
                Resource resource = new Resource();
                resource.Id = new EventId(i);
                resource.Name = names[i];
                resource.Color = colors[i];
  
                resource.Image = this.imageList1.Images[i];
                this.radSchedulerDemo.Resources.Add(resource);
            }
 
            this.radSchedulerDemo.GetDayView().ResourcesPerView = 2;
            this.radSchedulerDemo.GroupType = GroupType.Resource;
            SchedulerDayViewGroupedByResourceElement headerElement = this.radSchedulerDemo.SchedulerElement.ViewElement as SchedulerDayViewGroupedByResourceElement;
            headerElement.ResourceHeaderHeight = 135;
 
            for (int i = 0; i < summaries.Length; i++)
            {
                appointment = new Appointment(start[i], end[i], summaries[i],
                    descriptions[i], locations[i]);
                appointment.ResourceId = this.radSchedulerDemo.Resources[0].Id;
                appointment.BackgroundId = (int)backgrounds[i];
                this.radSchedulerDemo.Appointments.Add(appointment);
            }
 
            SchedulerDayViewGroupedByResourceElement dayView = this.radSchedulerDemo.SchedulerElement.ViewElement as SchedulerDayViewGroupedByResourceElement;
            dayView.ScrollToWorkHours();
 
            this.radSchedulerDemo.ActiveViewChanged += new EventHandler<SchedulerViewChangedEventArgs>(radSchedulerDemo_ActiveViewChanged);
            this.radSchedulerDemo.PropertyChanged += new PropertyChangedEventHandler(radSchedulerDemo_PropertyChanged);
            this.radSchedulerDemo.MouseDown += new MouseEventHandler(radSchedulerDemo_MouseDown);
 
            this.radSchedulerDemo.SchedulerElement.SetResourceHeaderAngleTransform(SchedulerViewType.Timeline, 0);
 
            this.radSchedulerNavigator1.AssociatedScheduler = this.radSchedulerDemo;
        }

 

Regards,

2 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 04 Jul 2017, 06:53 AM
Hello Alex, 

Thank you for writing.  

The AppointmentTitleFormat allows you to customize the text displayed in the appointment element. In the following help article, you can find the available options for embedding information in the title: http://docs.telerik.com/devtools/winforms/scheduler/appointments-and-dialogs/working-with-appointments

In order to show the descriptions, please subscribe to the AppointmentFormating event of RadScheduler and set the AppointmentElement property ShowAppointmentDescription to true
private void radScheduler1_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
{
    e.AppointmentElement.ShowAppointmentDescription = true;
}

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
ALEX
Top achievements
Rank 1
answered on 04 Jul 2017, 08:21 AM
It's working perfect. Thanks.
Tags
Scheduler and Reminder
Asked by
ALEX
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
ALEX
Top achievements
Rank 1
Share this question
or