Scheduler resources in timelineview resets RangeStartDate

6 posts, 0 answers
  1. George
    George avatar
    11 posts
    Member since:
    Feb 2014

    Posted 22 Jul 2014 Link to this post

    Hello,

    i found this post
    http://www.telerik.com/forums/grouping-appointments-in-timeline-view

    and I have the same problem as desrcibed in the 4th post by Tom.
    When I set the hour range to start any time of the day, it works fine, but if I enable Resources via GroupType property,
    it goes back to 00:00.

    For instance if the RangeStartDate and RangeEndDate are set to         2014-07-22 09:00 -> 2014-07-22 15:00,
    when I set Me.Scheduler.GroupType = GroupType.Resource it will be   2014-07-22 00:00 -> 2014-07-22 06:00.


    In the previous post I mentioned, Anton said there is no way to fix this.
    This is a 10 month old post.
    Is there any way to achieve this now?

    Thanks.
  2. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 23 Jul 2014 Link to this post

    Hello George,

    Thank you for writing back.

    Currently, you can set only a start hour out of the box. This can be achieved by using the StartDate property. Also you can use this property to display a specific range by adding or removing a specific time interval when the user scrolls the view. You can set the number of displayed hours as well. For example you can interval from 9 to 17 as follows:
    void Form1_Load(object sender, EventArgs e)
    {
        Timescales scale = Timescales.Hours;
         
        SchedulerTimelineView timelineView = this.radScheduler1.GetTimelineView();
        timelineView.ShowTimescale(scale);
        timelineView.CurrentScale.DisplayedCellsCount = 9;
        timelineView.PropertyChanged += timelineView_PropertyChanged;
     
        timelineView.StartDate = new DateTime(2010, 2, 1, 9, 0, 0);
    }
     
    void timelineView_PropertyChanged(object sender, PropertyChangedEventArgs e)
    {
        if (e.PropertyName == "StartDate")
        {
            if (this.radScheduler1.ActiveView.StartDate.Hour > 9)
            {
                this.radScheduler1.ActiveView.StartDate = radScheduler1.ActiveView.StartDate.Date.AddHours(9).AddDays(1);
            }
     
            if (this.radScheduler1.ActiveView.StartDate.Hour < 9)
            {
                this.radScheduler1.ActiveView.StartDate = radScheduler1.ActiveView.StartDate.Date.AddHours(-9).AddDays(-1);
            }
        }
    }

    I hope this helps. Should you have any other questions do not hesitate to ask.
     
    Regards,
    Dimitar
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. George
    George avatar
    11 posts
    Member since:
    Feb 2014

    Posted 24 Jul 2014 in reply to Dimitar Link to this post

    Hello Dimitar thanks for your reply.
    I used your code (in vb) but unfortunately no matter what I do I do not get the behaviour I am looking for.
    I am attaching two screenshots to make myself more clear.

    I want a timelineview that displays timescale in hours and can have a range in one day only (therefore, 24 hours max)
    There is never a scroll bar in the scheduler, it must always fit the size of its container.
    I set startDate and RangeStartDate to 05:00 and RangeEndDate to 23:59

    After I change the scheduler group type to resource
    (Me.Scheduler.GroupType = GroupType.Resource)
    my scheduler changes from whatiwant.png to whatihave.png

    I even have a button to toggle between GroupType.Resource and GroupType.None for debugging purposes and the scheduler changes between what is shown in the two screenshots.


  5. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 25 Jul 2014 Link to this post

    Hello George,

    Thank you for writing back.

    The provided screenshots are greatly appreciated. I was able to reproduce the issue you are facing. In Q2 2014 we have introduced an improved RadScheduler, allowing the user to define time ranges in the timeline view. Here is the Feedback Item for your reference. However, I can confirm that setting the RangeEndDate for the SchedulerTimelineView does not behave as expected when it belongs to the same date as the RangeStartDate. I have logged it in our Feedback Portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - Feedback Item.

    I have also updated your Telerik points.

    Currently, the possible solution that I can suggest is to set the RangeEndDate to be with at least a day greater than the RangeStartDate. The horizontal scroll bar will be hidden in order to stop the time navigation. Please find attached a sample project.

    I hope this information helps. If you have any additional questions, please let me know.

    Regards,
    Desislava
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  6. George
    George avatar
    11 posts
    Member since:
    Feb 2014

    Posted 28 Jul 2014 in reply to Dess Link to this post

    Hello Desislava,

    thank you for your response.

    Your code is providing me with the behaviour I need, but if there is only one resource added to the scheduler,
    the horizontal scroll bar will be shown no matter what.
    I tried setting the TimelineScrollNavigationElement to collapsed from the smart tag but it did not work.
    I guess using only one resource is not an option for the moment, I hope this will be fixed in the future.
  7. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 31 Jul 2014 Link to this post

    Hello George,

    Thank you for writing back.

    We will do our best to introduce a fix as soon as possible in the upcoming releases. However, you can handle the case when only one resource is displayed in the scheduler view and hide manually the NavigationElement:
    Private Sub RadToggleButton1_ToggleStateChanged(sender As Object, args As StateChangedEventArgs) _
    Handles RadToggleButton1.ToggleStateChanged
        If args.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On Then
            Me.RadScheduler1.GroupType = GroupType.Resource
        Else
            Me.RadScheduler1.GroupType = GroupType.None
        End If
        Dim timeline As TimelineGroupingByResourcesElement = TryCast(Me.RadScheduler1.SchedulerElement.ViewElement,  _
            TimelineGroupingByResourcesElement)
        If timeline IsNot Nothing AndAlso timeline.GetTimelineElements.Count > 0 Then
            timeline.GetTimelineElements(0).NavigationElement.Visibility = ElementVisibility.Collapsed
        End If
    End Sub

    I hope this information helps. If you have any additional questions, please let me know.

    Regards,
    Desislava
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
UI for WinForms is Visual Studio 2017 Ready