Data Binding PeriodStart and PeriodEnd

3 posts, 0 answers
  1. Joe Schick
    Joe Schick avatar
    14 posts
    Member since:
    Oct 2009

    Posted 06 May 2011 Link to this post


    Data binding PeriodStart and PeriodEnd doesn't seem to work. Is this supported?

    Version: 2011.1.419.1040


  2. EM
    EM avatar
    21 posts
    Member since:
    Oct 2006

    Posted 07 May 2011 Link to this post


    I use one-way binding for PeriodStart and PeriodEnd.  I just had to make sure the view model for the data context is not null and that the dates are valid at the time the timebar is loaded or bad things happen.

    My solution was simply to give dummy, if valid initial date values for my properties bound to PeriodStart and PeriodEnd.

  3. Yavor
    Yavor avatar
    401 posts

    Posted 10 May 2011 Link to this post

    Hi EM,

    RadTimeBar behaves in similar fashion like a framework Slider. When you set the PeriodStart / End through binding, the binding expressions get evaluated after the control has been loaded. We are using coercing (similarly to Slider) on all relevant properties to ensure that they will be OK, and because the binding expression is not evaluated when this coercion happens, the corrected value is set and the binding gets lost.

    One way of overcoming this is to set FallbackValue on the binding expression that is valid. Another approach could be to use two-way binding mode. This way setting the coerced value will not remove the binding expression that is set. Your approach is also valid and works great. No matter which approach you choose, just make sure that the default values are correct (PeriodEnd >= VisibleRange >= PeriodStart).

    Yavor Ivanov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top