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

Binding RadTimeBar to Linq to SQL with WCF

5 Answers 64 Views
TimeBar
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 02 Jun 2011, 03:09 PM
Telerik,

Is there a way to bind a RadTimeBar to a Linq to SQL class using WCF?

Regards,

Jason

5 Answers, 1 is accepted

Sort by
0
Missing User
answered on 08 Jun 2011, 06:44 AM
Hi Jason,

The RadTimeBar is a time bound control and works mainly with DateTime objects. When data binding the RadTimeBar, you can use MVVM and the desired technology for retrieving the data (in your case WCF service) and it will work as expected. Basically you can define LINQ-to-SQL queries inside a WCF Service and create WCF clients to display data returned by a WCF Service method.

Please note that the RadTimeBar behaves in a similar way 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. Thus you need to use two-way binding mode or FallbackValue on the binding expression that is valid. This way setting the coerced value will not remove the binding expression that is set.

Greetings,
Polina
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
0
Jason
Top achievements
Rank 1
answered on 08 Jun 2011, 09:27 AM
Polina

Do you have an example of the above?

Thanks.
0
Missing User
answered on 13 Jun 2011, 11:38 PM
Hi Jason,

I have attached a sample project that demonstrates how to bind the RadTimeBar control using MVVM and WCF service. Please note that the project is for demonstration purposes only and you will have to set up the WCF service and the Database locally in order to run it. I also want to emphasize that the setup of the WCF service and its integration with LINQ-to-SQL is not TimeBar related issue. For more information about Building and Accessing Services, please refer to the MSDN resources here. I hope this will help you get started properly.

Best wishes,
Polina
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
0
Jason
Top achievements
Rank 1
answered on 14 Jun 2011, 10:31 AM
Many thanks for this.  Could you expand the solution to include a radareasparkline please?

Thanks.
0
Missing User
answered on 16 Jun 2011, 12:13 PM
Hi Jason,

Basically, you need to add RadAreaSparkline control as a content of the TimeBar and bind its ItemSource property according to the TimeBar.PeriodStart and TimeBar.PeriodEnd properties. In the attachment you can find the modified files according to the described scenario. You can also review our TimeBar Area Visualisation demo here.

Best wishes,
Polina
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
Jason
Top achievements
Rank 1
Answers by
Missing User
Jason
Top achievements
Rank 1
Share this question
or