BUG - Headers are missing if not defined in Intervals collection...

2 posts, 0 answers
  1. Rob
    Rob avatar
    238 posts
    Member since:
    Jan 2009

    Posted 20 Dec 2011 Link to this post

    I have a RadTimeBar defined like this:
        PeriodStart="{Binding PeriodStart, Mode=TwoWay}"
        PeriodEnd="{Binding PeriodEnd, Mode=TwoWay}"
        VisiblePeriodStart="{Binding VisiblePeriodStart, Mode=TwoWay}"
        VisiblePeriodEnd="{Binding VisiblePeriodEnd, Mode=TwoWay}"
        SelectionStart="{Binding SelectionStart, Mode=TwoWay}"
        SelectionEnd="{Binding SelectionEnd, Mode=TwoWay}"
            <telerik:WeekInterval />

    My viewmodel properties in this scenario are set to:
    PeriodStart = new DateTime(2011, 1, 1, 0, 0, 0);
    PeriodEnd = new DateTime(2012, 12, 31, 0, 0, 0);
    VisiblePeriodStart = PeriodStart;
    VisiblePeriodEnd = PeriodEnd;
    SelectionStart = new DateTime(2011, 10, 9);
    SelectionEnd = new DateTime(2011, 10, 15);

    When the app loads, I basically get a blank RadTimeBar (see attached picture).  If I add "<telerik:MonthInterval />" to the intervals collection it seems to work better... but alas...  in my scenario I want to show only weeks as the items.  If I adjust the zooming I can eventually get the headers to show up.

  2. Tsvetie
    Tsvetie avatar
    1517 posts

    Posted 21 Dec 2011 Link to this post

    Hello Rob,
    First of all, let me explain how the timebar picks the interval to display out of the intervals in its Intervals collection.

    Basically, the control searches for the shortest(in terms of time) interval type, for which there is enough space to show the interval items' labels. The space available for every item in the visible period interval depends on the width of the timebar control and the number of items in the current visible period range.

    In your case, the timebar is about 800 pixels and the week items are about one hundred. This means that there are approximately 8 pixels for every week item, which is not enough for any of the week interval label formats. For the timebar, this means that it cannot display the current visible period in weeks. As there are no other intervals in the Intervals collection, the timebar shows no interval items.Once the VisiblePeriod is reduced so that it can be represented in week intervals, those items are displayed. Once the interval items are displayed, they are not removed even if you zoom out to the initial case.

    I hope this explains the behavior of the timebar in your case and why this is actually expected. In case you explain in detail what you expect as behavior in this case, I will be able to provide you with information whether this is possible and how you can achieve it with our control.

    All the best,
    the Telerik team

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

  3. DevCraft R3 2016 release webinar banner
Back to Top