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

Data Binding PeriodStart and PeriodEnd

2 Answers 108 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
Joe Schick
Top achievements
Rank 1
Joe Schick asked on 06 May 2011, 08:14 PM
Hi,

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

Version: 2011.1.419.1040

Thanks,

Joe

2 Answers, 1 is accepted

Sort by
0
EM
Top achievements
Rank 1
answered on 07 May 2011, 12:17 PM
Hello,

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
Tags
TimeBar
Asked by
Joe Schick
Top achievements
Rank 1
Answers by
EM
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or