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.
E.
0
Yavor
Telerik team
answered on 10 May 2011, 08:39 AM
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).
Greetings,
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