Controlling the overlapping on adjacent entries

6 posts, 0 answers
  1. Ola
    Ola avatar
    8 posts
    Member since:
    May 2013

    Posted 13 May 2013 Link to this post

    Hi!

    Is it possible to get the control to not separate items on different rows when they are sharing a common point.

    first item has Datetime(2013,5,5,1,0,0) and duration 2 hours.
    second item has Datetime(2013,5,5,3,0,0) and duration 2 hours. 

    I want them to be on the same line without changing the first item's duration to for example 1 hour, 59 minutes and 59 seconds...

    Hope it makes sense. 
  2. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 16 May 2013 Link to this post

    Hi Ola,

    Currently the only mechanism for dealing with overlapping items that the RadTimeline supports is to position them on separate rows. Exposing additional options for controlling the behavior in this scenario is in our TODO list and this functionality is planned to be released with our 2013 Q3 release. 

    Since you were one of the first users to ask for this type of functionality we will appreciate if you provide more details on your requirements and your thoughts on how you would like this to be implemented (as API). Our development team is in the early stages of researching this feature, so they  are open to any feedback.

    Currently you can implement this by having an additional ItemsSource collection containing the combined (clustered) items. You will need to manually combine these items. Currently there are several ways of doing this that I can think of:
    • Keep the second ItemsSource as items grouped by a specific interval - e.g. month. That way in the common case the user will see items grouped by month which are not overlapping. When the user zooms in, you can switch to showing the original ItemsSource for a more detailed visualization of the data. You can use the VisiblePeriodChanged event to swap the ItemsSource when this is needed.
    • Dynamically group the items depending on the RadTimeline.CurrentItemInterval property. 
    • Instead of grouping the items by interval, combine only the ones that overlap. You can do this initially, as soon as you have the original ItemsSource.
     
    Regards,
    Petar Kirov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Ola
    Ola avatar
    8 posts
    Member since:
    May 2013

    Posted 16 May 2013 Link to this post

    Hi Petar!
    Thanks for the extensive answer!

    I just would want to have the option of putting ObjectA next to ObjectB when ObjectA.EndTime == ObjectB.StartTime.

    So if the component could split objects on separate lines when ObjectA.EndTime <= ObjectB.StartTime that would be perfect. Now it seems like the test is ObjectA.EndTime < ObjectB.StartTime

    Example, Meeting A ends at 9.30am, Meeting B starts at 9:30am, Why put them on separate lines?

    So for the API for the control I would love to have RadTimeLine.KeepAdjacentObjectsOnTheSameLinePlease = true/false :)

    Regards,
    Ola
  5. Ola
    Ola avatar
    8 posts
    Member since:
    May 2013

    Posted 21 May 2013 Link to this post

    Here is the example visualized:

    Example

    I would love to have those items on the same line without changing the startTime to one second in the future.
    Please let me know if you understand, and if my request is possible with the existing control.

    Best Regards
    Ola
  6. Ola
    Ola avatar
    8 posts
    Member since:
    May 2013

    Posted 21 May 2013 Link to this post

    Workaround:

    For anyone with similar problem, and want all activities in the timeline to be on one line when sharing same DateTime.


    in the xaml, set your DurationPath like this:
    DurationPath="DurationWithOneLessSecond"

    Then from your datamodel, set the property like below. This just affects the visual representation of the items, and won't mess with your data.

    private TimeSpan _Duration; public TimeSpan Duration { get { return _Duration; } set { _Duration = value; NotifyPropertyChanged("Duration"); } }
            public TimeSpan DurationWithOneLessSecond
            {
                get
                {
                    return Duration.Add(TimeSpan.FromSeconds(-1));
                }
                set
                {
                    Duration = value.Add(TimeSpan.FromSeconds(1));
                    NotifyPropertyChanged("DurationWithOneLessSecond");
                }
            }
  7. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 22 May 2013 Link to this post

    Hi Ola,

    Thanks for the suggestion. It will certainly make a good addition to the control. I forwarded it to our development team, so they can consider it when planning the features for our future releases.

    Meanwhile you can use the workaround that you came with, as it looks correct to me. 

    Regards,
    Petar Kirov
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner