Custom Week Month Item Display Format

Hi everyone,

I want to display the appointment in the format of "[subject] [starttime] - [endtime]".
I have set the WeekMonthItemFormat property of the schedule control like this

scheduleControl1.Appearance.WeekMonthItemFormat = "[subject] [starttime] - [endtime]";

But I get the output as "[subject] [starttime] - [starttime]"

Instead of the endtime the start time is displayed.
How can I fix this to show the subject, start time and end time?

Thanks in advance.

Risath



2 Replies

AN Anonymous April 1, 2008 04:18 PM UTC

This is a defect that we will correct in our library. Until there is a release with this corrected, you can avoid the problem by handling the display item parsing event and do the parsing yourself.


this.scheduleControl1.ParseDisplayItem += new ParseDisplayItemEventHandler(scheduleControl1_ParseDisplayItem);

//....
void scheduleControl1_ParseDisplayItem(object sender, ParseDisplayItemEventArgs e)
{
if (e.Format == "[subject] [starttime] - [endtime]")
{
string s = string.Format("{0} ", e.Item.Subject);
s += e.Item.StartTime.ToString(this.scheduleControl1.Appearance.TimeFormat, this.scheduleControl1.Culture);
s += " " + e.Item.EndTime.ToString(this.scheduleControl1.Appearance.TimeFormat, this.scheduleControl1.Culture);
e.FormattedText = s;
e.Handled = true;
}
}





RI Risath April 2, 2008 03:26 AM UTC

Thanks a lot Clay Burch.


Loader.
Up arrow icon