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

Can you remove the times from the appointment details?

11 Answers 238 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Craig Gamble
Top achievements
Rank 1
Craig Gamble asked on 10 Apr 2009, 03:00 PM
is it possible to remove the times?

i am using the monthview where the appointments (or should i say availibilites) are in days and no time is ever specified. this gives me a 00:00AM - 00:00AM in each of the appointments which looks bad. can it be hidden?

i am binding using a dataprovider also

Cheers,
Craig

11 Answers, 1 is accepted

Sort by
0
Accepted
Jordan
Telerik team
answered on 13 Apr 2009, 12:40 PM
Hi Craig Gamble,

Yes, it is possible. You just have to set the AppointmentTitleFormat property to a format that omits the start and end values ({0} and {1}) like bellow:

this.radScheduler1.AppointmentTitleFormat = "{2} ({3})";

Also, would you like this feature more if instead of 0, 1, 2 ... were used start, end, etc. (so that the above format would be something like "{{subject}} ({{location}})")?

Greetings,
Jordan
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Craig Gamble
Top achievements
Rank 1
answered on 15 Apr 2009, 08:08 AM
thats great thanks.

yeah if you could make it {subject} {location} etc i think it would make it easier to understand for other programmers who may have to work on the code at a later date.

Cheers,
Craig
0
Matthew Link
Top achievements
Rank 1
answered on 30 Jul 2010, 01:24 PM
Related to this,  Is it possible to still show the dates, but not include the times?
0
Dobry Zranchev
Telerik team
answered on 03 Aug 2010, 10:19 PM
Hello Matthew Link,

Thank you for writing.

The way to do it is to subscribe for the AppointmentFormating event of the scheduler and set the AppointmentTitleFormat property of the AppointmentElement that is a parameter of the arguments to {0: MM/dd/yyyy} {1:MM/dd/yyyy} {2} {3} where:
- {0} is StartDate of the appointment
- {1} is EndDate
- {2} is Summary
- {3} is Location

For further questions feel free to contact us.

All the best,
Dobry Zranchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Matthew Link
Top achievements
Rank 1
answered on 04 Aug 2010, 05:07 PM
Thanks!  That's just what I needed.
0
Thi Han
Top achievements
Rank 1
answered on 27 Dec 2011, 11:30 AM
I want to show the subject in schedular .So how to do that  AppointmentTitleFormat.?
0
Ivan Petrov
Telerik team
answered on 30 Dec 2011, 02:13 PM
Hi Thi Han,

Thank you for writing.

As Dobry explained in his post you have to subscribe to the AppointmentFormating event of the RadScheduler and set the TitleFormat of the appointment element. Also there are four pieces of data that can be included in the displayed string using this title format:
  • {0} - Start date
  • {1} - End date
  • {2} - Subject
  • {3} - Location
Consider the following AppointmentFormating event handler which leaves only the subject to be displayed in the scheduler:
private void radScheduler1_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
{
  e.AppointmentElement.TitleFormat = "{2}";
}

I hope this will be useful. If you have further questions we would be glad to assist.
 
Kind regards,
Ivan Petrov
the Telerik teamQ3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Gaston
Top achievements
Rank 1
answered on 27 Jan 2014, 10:15 AM
Do you think it is possible to see other information on the AppointmentTitleFormat property such as description or Resources?
0
Ivan Petrov
Telerik team
answered on 29 Jan 2014, 04:08 PM
Hello Gaston,

Thank you for writing back.

Practically, any text you add as literal to a format string will be displayed as is. Therefore in the AppointmentFormatting event you can add any text to the e.AppointmentElement.FormatString property, including the description of the appointment and its resource name. Here is an example:
private void radScheduler1_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
{
    IResource resource = e.AppointmentElement.Scheduler.GetResourceStorage().GetById(e.Appointment.ResourceId);
    e.AppointmentElement.TitleFormat = "{2} " + e.Appointment.Description + resource.Name;           
}

You can further customize the text by adding some HTML text formatting to the text.

I hope this helps. Do not hesitate to write back with further questions.

Regards,
Ivan Petrov
Telerik
TRY TELERIK'S NEWEST PRODUCT - APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Gaston
Top achievements
Rank 1
answered on 30 Jan 2014, 12:03 AM
I tried to use your code in my project to test it out... and it did not work, it kept showing me the default view. I am new C# so I am sure I am doing something wrong on my end. Can you explain to me on how to implement the code? 
Thank you, :D
0
Ivan Petrov
Telerik team
answered on 31 Jan 2014, 10:22 AM
Hello Craig,

Thank you for your reply.

There are couple of things to consider regarding my previous code snippet. First you have to subscribe to the event before you populate your scheduler. If you are not sure whether this is the case you can run your project and move (drag drop) an appointment to another time slot. If the text it displays changes then you have subscribed too late. If it does not change then you have not subscribed at all. The second thing to consider is that there might be appointments without resource. In this case the resource object from my example might be null which would result in a NullReferenceException when resource.Name is called. To solve this you should add a check for null before the 

If none of these solves the problem I would ask you to send me your project or an example one resembling your project which I can use to diagnose the problem. 

Looking forward to your reply.

Regards,
Ivan Petrov
Telerik
TRY TELERIK'S NEWEST PRODUCT - APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Scheduler and Reminder
Asked by
Craig Gamble
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Craig Gamble
Top achievements
Rank 1
Matthew Link
Top achievements
Rank 1
Dobry Zranchev
Telerik team
Thi Han
Top achievements
Rank 1
Ivan Petrov
Telerik team
Gaston
Top achievements
Rank 1
Share this question
or