VisiblePeriodStart changes unpected

4 posts, 0 answers
  1. KS
    KS avatar
    2 posts
    Member since:
    Apr 2012

    Posted 25 Apr 2012 Link to this post

    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


  2. Peshito
    Admin
    Peshito avatar
    496 posts

    Posted 30 Apr 2012 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. KS
    KS avatar
    2 posts
    Member since:
    Apr 2012

    Posted 01 May 2012 Link to this post

    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


  5. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 01 May 2012 Link to this post

    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 >>

Back to Top