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

VisiblePeriodStart changes unpected

3 Answers 50 Views
TimeLine
This is a migrated thread and some comments may be shown as answers.
KS
Top achievements
Rank 1
KS asked on 25 Apr 2012, 10:41 AM
Hi,

I am trying to use timeline component, and here is what I write in (view) xaml file,

<telerik:RadTimeline Height="80"
                     PeriodStart="{Binding StartDate, Mode=TwoWay}"
                     PeriodEnd="{Binding EndDate, Mode=TwoWay}"
                     VisiblePeriodStart="{Binding VisibleStart, Mode=TwoWay}"
                     VisiblePeriodEnd="{Binding VisibleEnd, Mode=TwoWay}"
                     StartPath="Date"
                     DurationPath="Duration"
                     ItemsSource="{Binding Results}">

and in the (view model) code behind,
private void InitTimeRange()
{
    StartDate = DateTime.Today;
    EndDate = StartDate.AddDays(1);
 
    DateTime now = DateTime.Now;
    VisibleStart = now.AddMinutes(-30);
    VisibleEnd = now.AddMinutes(30);
}

and turns out the VisibleStart is forced to set as StartDate, it looks like be changed at 
TimeBarBase.CoerceVisiblePeriod(),
while VisibleEnd seems to be correct, 

is it a calling sequence issue here? how can I fix this?

Thanks


3 Answers, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 30 Apr 2012, 12:02 PM
Hello,

The VisiblePeriodStart cannot be less then the StartDate. In order to be able to display the VisiblePeriodStart in the way you have defined it in your code, you will also need to change your PeriodStart date. On the other hand the VisibleEnd is correct because your EndDate is bigger.

You can find more information here:
http://www.telerik.com/help/silverlight/radtimeline-properties.html

Hope this helps.

Kind regards,
Peshito
the Telerik team

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

0
KS
Top achievements
Rank 1
answered on 01 May 2012, 05:27 AM
Hi,

Actually, I do think the range is appropriate,

-----+----------------------------------+-------------------------------+-------------------------------------+-----
StartDate                           VisibleStart                       VisibleEnd                                   EndDate

2012/05/01                         2012/05/01                      2012/05/01                               2012/05/02
AM 12:00:00                      AM 11:30:00                    PM 12:30:00                              AM 12:00:00
 
here is an example of my time settings, you can also see it in the attached code behind,

there are two corner cases that it exceeds the bound as you mentioned, but not the most of other cases

actually, I have assign the values (like above) directly in xaml and that works,

furthermore, if I hardcode to "initialize" in the constructor like
InitializeComponent();
 
this.timeline.PeriodStart = DateTime.Today;
this.timeline.PeriodEnd = DateTime.Today.AddDays(1);

it also works, I think the issue is the initial value of PeriodStart is unexpected
and there is a calling sequence issue when directly binding in xaml


0
Tsvetie
Telerik team
answered on 01 May 2012, 10:57 AM
Hi,

Unfortunately, the information that you have provided is not enough for me to determine the cause for the problem that you describe in your last post. The behavior that you described with the concrete settings in your original post is expected, because the Visible period must be a subset of the whole Period that the timeline visualizes, just as Peshito explained.

I will need some additional information on your scenario, in order to be able to find the cause for the problem from your last post. For example:
  • What is your concrete setup
  • What steps do you follow in order to reproduce the problem
  • What is the concrete problem

It would be best if you open an official support ticket and send us a simple running project, demonstrating this problem, together with concrete steps for reproducing it.

Regards,
Tsvetie
the Telerik team

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

Tags
TimeLine
Asked by
KS
Top achievements
Rank 1
Answers by
Peshito
Telerik team
KS
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or