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

Date format of items in TimelineView

6 Answers 248 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Lester
Top achievements
Rank 1
Lester asked on 16 Mar 2011, 04:43 PM
Hi,

Appointments in Timeline View have a date associated with them when the Time Scale is set as either Month or Year.
The date format is mm/dd for Month View and mm/dd/yy for Year View.
 
Can I change this to dd/mm for Month View and dd/mm/yy for Year View.

Please see snapshot attached.

6 Answers, 1 is accepted

Sort by
0
Dobry Zranchev
Telerik team
answered on 18 Mar 2011, 03:02 PM
Hi Lester,

Thank you for writing.

In order to a set custom format for the AppointmentTitleFormat, you can follow the related documentation article. In addition, you can subscribe to the AppointmentFormatting event of the RadScheduler and to set the Text of the AppointmentElement that is returned by the event arguments.

In case that you have other related questions, feel free to write back.

Regards,
Dobry Zranchev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Khizar Khan
Top achievements
Rank 1
answered on 21 Mar 2011, 12:28 PM
Thanks,

I chose to modify the AppointmentTitleFormat.
Can you please let me know how can I -

1. "Bold" the Subject i.e. {2}
2. Format the date part to just retrieve date and not the time, i.e. from {0} and {1}

Thanks,
Lester
0
Khizar Khan
Top achievements
Rank 1
answered on 21 Mar 2011, 12:39 PM
Hi,

In addition to my reply previously, there is another consideration with the AppointmentTitleFormat.
I did have a look at the Article. The AppointmentTitleFormat can be set to {0} {1} {2} and/or {3}
which gives the start date and time, end date and time, subject and location respectively.

However the Timeline View in Month Timescales shows the Day of the week which I am not able to set using AppointmentTitleFormat.

Can you please help.

Thanks,
Lester
0
Accepted
Ivan Todorov
Telerik team
answered on 23 Mar 2011, 04:28 PM
Hi Khizar Khan,

Thank you for writing back.

You can bold the subject by surrounding it with HTML bold tags. Formatting the dates uses the standard .NET date format strings. You can find them explained here. Here is how the format string should look like:
radScheduler1.AppointmentTitleFormat = "<b>{2}</b> from {0:dd/MM/yy} to {1:dd/MM/yy}";

As you can see in the article mentioned above, the day of the week is taken from the date itself via a format string so you can display it using the following format string:
radScheduler1.AppointmentTitleFormat = "<b>{2}</b> from {0:ddd d} to {1:ddd d}";

I hope you find this useful. If you have any further questions, feel free to ask.

All the best,
Ivan Todorov
the Telerik team
0
Anouar
Top achievements
Rank 1
answered on 08 Apr 2013, 11:20 PM
Hi Support,

I just want to know if it's possible to print other attribut of the Appointment than start date, end date, subject and location.

Actually I use a class who inherit from the Appointment class and I want print in the Appointment description in my Radscheduler a parameter of my class.

Tanks in advance.

Regards,

Anouar
0
Ivan Petrov
Telerik team
answered on 11 Apr 2013, 02:35 PM
Hi Anouar,

Thank you for writing.

You can modify the text that is displayed in the appointment elements through the AppointmentFormatting event and the TitleFormat of the appointment element. Here is an example:
private void radScheduler2_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
{
    if (e.Appointment is MyCustomAppointment)
    {
        AppointmentTitleFormatter formatter = (new AppointmentTitleFormatterFactory()).Create(e.AppointmentElement.View.ViewType);
        string s = formatter.GetTitleFormat(e.AppointmentElement, e.AppointmentElement.View, this.radScheduler1);
        e.AppointmentElement.TitleFormat = s + "\n\r" + ((MyCustomAppointment)e.Appointment).MyAdditionalProperty;
    }
}

I hope this will be useful. Should you have further questions, I would be glad to help.

Kind regards,
Ivan Petrov
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Tags
Scheduler and Reminder
Asked by
Lester
Top achievements
Rank 1
Answers by
Dobry Zranchev
Telerik team
Khizar Khan
Top achievements
Rank 1
Ivan Todorov
Telerik team
Anouar
Top achievements
Rank 1
Ivan Petrov
Telerik team
Share this question
or