Telerik Silverlight Controls in ASP.Net web application

Nirav

I am new to silverlight....my requirements are for the fancy charts/gauges available in the telerik silverlight rad controls product. The problem is that I need to implement these silverlight charts/gages into an existing asp.net page.

I have to bind the data from a sql database to a chart and gauge in the existing asp.net web pages.

Petar Marchev

Almost none of our Silverlight controls work directly with stored procedures. The majority of our controls work with regular C# objects and collections.

For example the ChartView only works with a collection (no stored procedures and no domain data source). It requires a simple IEnumerable as ItemsSource and it is origin agnostic (it is not important where the collection came from). So as long as you build your application to expose these as properties in your view model and bind these properties in xaml, the chart will work. I suggest you start examining the links from my previous response.

Regards,
Petar Marchev
Telerik

Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.

Martin

As my colleague Petar stated in its last reply, the RadChartView suite works with a .NET collections (IEnumerable, IList, etc.). The same rule applies for most of our controls that displays some set of data (RadListBox, RadTreeView, RadPanelBar, RadGridView, etc.). Each of those controls expects an collection with .NET objects.

Basically before pass the items from your database to the RadChartView you can wrap them in a view models. Let's take for example the following table:

You can get and filter the data you will need to pass in the chart with the Linq to SQL and then you can wrap it in your view models (or directly try to pass the collection returned from the linq query). Here is a sample pseudo code for this:

Also, keep in mind that you cannot bind a property of an UI element to the database. There is no direct connection between the UI and the database. In order to make such connection you will need to handle the query to/from your database in the property's setter/getter. Here is an example:

public class GaugeViewModel

{

private double gaugeValue;

public double GaugeValue

{

set

{

this.gaugeValue = value;

// make the query to your database that will change the value in the database

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.