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

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

1 Answer 27 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 20 Dec 2011, 08:54 PM
I have a RadTimeBar defined like this:
<telerik:RadTimeBar
    x:Name="rtb"
    Width="800"
    Height="160"
    IsSnapToIntervalEnabled="True"
    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:RadTimeBar.Intervals>
        <telerik:WeekInterval />
    </telerik:RadTimeBar.Intervals>
</telerik:RadTimeBar>

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.

1 Answer, 1 is accepted

Sort by
0
Tsvetie
Telerik team
answered on 21 Dec 2011, 01:39 PM
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,
Tsvetie
the Telerik team

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

Tags
TimeBar
Asked by
Rob
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or