Date format of items in TimelineView

7 posts, 1 answers
  1. Lester
    Lester avatar
    8 posts
    Member since:
    Mar 2011

    Posted 16 Mar 2011 Link to this post

    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.
  2. Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 18 Mar 2011 Link to this post

    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!
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Khizar Khan
    Khizar Khan avatar
    41 posts
    Member since:
    Jan 2010

    Posted 21 Mar 2011 Link to this post

    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
  5. Khizar Khan
    Khizar Khan avatar
    41 posts
    Member since:
    Jan 2010

    Posted 21 Mar 2011 Link to this post

    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
  6. Answer
    Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 23 Mar 2011 Link to this post

    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
  7. Anouar
    Anouar avatar
    7 posts
    Member since:
    Feb 2013

    Posted 08 Apr 2013 Link to this post

    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
  8. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 11 Apr 2013 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready