Binding RadTimeBar to Linq to SQL with WCF

6 posts, 0 answers
  1. Jason
    Jason avatar
    5 posts
    Member since:
    Nov 2010

    Posted 02 Jun 2011 Link to this post

    Telerik,

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

    Regards,

    Jason
  2. Missing user
    Missing user avatar

    Posted 08 Jun 2011 Link to this post

    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
  3. DevCraft banner
  4. Jason
    Jason avatar
    5 posts
    Member since:
    Nov 2010

    Posted 08 Jun 2011 Link to this post

    Polina

    Do you have an example of the above?

    Thanks.
  5. Missing user
    Missing user avatar

    Posted 13 Jun 2011 Link to this post

    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
  6. Jason
    Jason avatar
    5 posts
    Member since:
    Nov 2010

    Posted 14 Jun 2011 Link to this post

    Many thanks for this.  Could you expand the solution to include a radareasparkline please?

    Thanks.
  7. Missing user
    Missing user avatar

    Posted 16 Jun 2011 Link to this post

    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
Back to Top
DevCraft banner