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

Month(and week) columns in timeline view

15 Answers 283 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Steffen
Top achievements
Rank 1
Steffen asked on 24 Mar 2011, 09:55 AM
Hi,

The new ScheduleView looks really great. However is it possible to have month and possible week names in columns above the day names in timeline view? Much like the attached sketch.

15 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 24 Mar 2011, 10:11 AM
Hello Steffen,

Currently we support only days as headers and time in the second line. The functionality you request is in our plans and we will do our best to provide it for Q2 2011 or shortly after.

Regards,
Valeri Hristov
the Telerik team
0
Paul
Top achievements
Rank 1
answered on 15 Jul 2011, 11:07 AM
Did this make it in the Q2 release?
0
Valeri Hristov
Telerik team
answered on 15 Jul 2011, 11:21 AM
Hello Paul,

Unfortunately this feature did not made it into the Q2 release. It is with high priority on our list and will be included in one of the next service packs.

Regards,
Valeri Hristov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Alex
Top achievements
Rank 1
answered on 29 Sep 2011, 08:19 AM
Hi Valeri,

We were looking forward to seeing this feature in the SP1 release as below:
http://www.telerik.com/community/forums/silverlight/scheduleview/calendar-scheduleview.aspx

Could you give us some light on when the next release is scheduled and when the feature will be included?
This is very important to us, we will need to consider timing and other options with the information you provide us

Kind Regards
0
Valeri Hristov
Telerik team
answered on 04 Oct 2011, 02:22 PM
Hello Alex,

Here is how to use the new functionality:
<telerik:RadScheduleView>
 <telerik:RadScheduleView.AppointmentsSource>
  <telerik:ObservableAppointmentCollection />
 </telerik:RadScheduleView.AppointmentsSource>
 <telerik:RadScheduleView.ViewDefinitions>
  <telerik:TimelineViewDefinition VisibleDays="30" MinTimeRulerExtent="5000" MajorTickLength="1day"
    GroupTickLength="1week" TimerulerMajorTickStringFormat="{}{0:d}" MinorTickLength="1day">
  </telerik:TimelineViewDefinition>
 </telerik:RadScheduleView.ViewDefinitions>
</telerik:RadScheduleView>

Best wishes,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Håkan
Top achievements
Rank 1
answered on 13 Oct 2011, 10:58 AM
Hi,

My ViewDefinition looks like this:
<telerik:TimelineViewDefinition x:Name="ScheduleViewDefinition" Title="Schema" Orientation="Horizontal" VisibleDays="7" MinorTickLength="1day" MajorTickLength="1day" GroupTickLength="1week" TimerulerGroupStringFormat="{}{0:dddd %d MMMM}" TimerulerMajorTickStringFormat="{}{0:dddd}" StretchGroupHeaders="True" AppointmentFilter="{Binding AppointmentsFilter}" />

But my group header says "monday 10 october - monday 17 october"
I guess it's becaude the VisibleRange.End is "2011-10-17 00:00:00".

I want it to display "monday 10 october - sunday 16 october".

Regards,
Håkan




0
Valeri Hristov
Telerik team
answered on 13 Oct 2011, 04:44 PM
Hello Håkan,

As far as I can see this is a bug, that should be fixed. Meanwhile you could implement the ITickLength interface on a new class and provide a custom format string for the timeruler groups. For example, a implementation that is nearly the same as the default follows and I suppose the problem is in the highlighted line:
public class CustomTickProvider : ITickProvider
{
 public CustomTickProvider()
 {
  this.Interval = new DateTimeInterval(0, 0, 1);
 }

 public DateTimeInterval Interval
 {
  get;
  set;
 }

 public DateTime GetNextStart(TimeSpan tickLength, DateTime currentStart)
 {
  if (this.Interval.Days > 0)
  {
   return AddInterval(currentStart.Date, this.Interval);
  }
  return AddInterval(currentStart, this.Interval);
 }

 public string GetFormatString(IFormatProvider formatInfo, string viewDefinitionFormatString, DateTime currentStart)
 {
  if (this.Interval.Days > 1 || this.Interval.Weeks > 0 || this.Interval.Months > 1)
  {
   return string.Format(formatInfo, viewDefinitionFormatString + "  -  " + viewDefinitionFormatString.Replace("0:", "1:"), currentStart, currentStart.AddInterval(this.Interval));
  }
  return string.Format(formatInfo, viewDefinitionFormatString, currentStart);
 }

 private static DateTime AddInterval(DateTime date, DateTimeInterval dateTimeInterval)
 {
  return date.AddMinutes(dateTimeInterval.Minutes).AddHours(dateTimeInterval.Hours).AddDays(dateTimeInterval.Days).AddDays(dateTimeInterval.Weeks * 7).AddMonths(dateTimeInterval.Months);
 }
}

You could use the provider like this:
<telerik:TimelineViewDefinition>
    <telerik:TimelineViewDefinition.GroupTickLength>
        <local:CustomTickProvider />
    </telerik:TimelineViewDefinition.GroupTickLength>
</telerik:TimelineViewDefinition>

Kind regards,

Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Håkan
Top achievements
Rank 1
answered on 10 Jan 2012, 11:23 AM
Hi Valerie!

Are there any changes in the Q3 release that will break the provided code example?
Because when I try this CustomTickProvider I get som compilation errors.

It seems DateTimeInterval doesn't contain a Weeks property.
It also complained at currentStart.AddInterval because of its protection level.
I used the private static method instead, seemed to work.

I tried to remove everything using the Weeks property. But that hanged the application, causing an Out of memory exception after awhile.
I set a breakpoint in the constructor of the CustomTickProvider and found that since there is no Weeks the Interval was set to 0.
I changed it so that it would be initialized with 7 days instead and then it seems to work.

Finally I added .AddSeconds(-1) to the AddInterval method and then the date range was displayed correctly.

Is this confirmed to be a bug, and in that case, what is the release plan on the fix?

Regards,
Håkan


0
Valeri Hristov
Telerik team
answered on 16 Jan 2012, 09:22 AM
Hi Hakan,

I apologize, I pasted a snippet from the original ScheduleView source code, and it appears that it uses properties and methods that are internal. The code didn't work on the first place, which is my mistake.

You could leave the DateTimeInterval and just create a couple of ITickProvider implementations - one for weeks and one for months. Please, find attached a sample application that works with the latest binaries.

All the best,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Håkan
Top achievements
Rank 1
answered on 16 Jan 2012, 09:42 AM
Thanks Valeri!

That was a much cleaner solution.

Regards,
Håkan
0
Håkan
Top achievements
Rank 1
answered on 06 Mar 2012, 03:56 PM
Hi again!

I found an issue with this solution...

If I set visible days to for example 14 and use the WeeklyTickProvider, it always displays a whole week even though the first day is not a monday (First day of week is set to monday).
See attached image where first day in the interval is a thursday and the last day is a wednesday.

This is understandable since the code in the WeeklyTickProvider looks like this:

public DateTime GetNextStart(TimeSpan tickLength, DateTime currentStart)
       {
           DateTime weekStart = CalendarHelper.GetFirstDayOfWeek(currentStart, DayOfWeek.Monday);
           return weekStart == currentStart.Date ? weekStart.AddDays(7) : weekStart;
       }

Is there any way I can get around this?

If I'm not using this custom tick provider, at least the first day is correct, but it still always add 7 days.

Regards,
Håkan
0
Yana
Telerik team
answered on 09 Mar 2012, 03:49 PM
Hello Håkan,

I am not sure I understand the requirement.  This is the expected behavior - the first day in TimelineView is the current date. And since VisibleDays is set to "14 days", the first and the last weeks are not complete.

Can you please explain in more details and/or send us a screenshot showing the needed approach?

Regards,
Yana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Håkan
Top achievements
Rank 1
answered on 09 Mar 2012, 04:13 PM
Hi Yana!

Yes, the first and last weeks are not complete, but as you can see in my attaced image,
the group header is always displaying whole weeks (monday to sunday).

I would like it to display:
Thursday to sunday in the first week
Monday to sunday in the second week
Monday to wednesday in the third and last week

The group header should display the actual days below it, not the whole week.
Hope you understand my problem now...

Regards,
Håkan

0
Yana
Telerik team
answered on 12 Mar 2012, 04:20 PM
Hello Håkan,

Thank you for sending the additional details.

I've modified the project, so now the headers should be shown as expected. Please download the attachment and give it a try.

Greetings,
Yana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Håkan
Top achievements
Rank 1
answered on 15 Mar 2012, 06:33 AM
Thanks Yana!

Now it works as expected.

Regards,
Håkan
Tags
ScheduleView
Asked by
Steffen
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Paul
Top achievements
Rank 1
Alex
Top achievements
Rank 1
Håkan
Top achievements
Rank 1
Yana
Telerik team
Share this question
or