Databinding for the Sparkline control involves the correlation between the business logic/data, and the visualization of the control.

The DataBinding involves the following three properties:

SparkLine.ItemsSource - gets or sets the data source used to generate the content of the sparkline control. Elements can be bound to data from a variety of data sources in the form of common language runtime (CLR) objects and XML - see the list of the supported data sources bellow.

Sparkline.XValuePath - sets the name of the property from the underlying datasource, which will determine the position of each datapoint along the x axis.

Sparkline.YValuePath - sets the name of the property from the underlying datasource, which will determine the position of each datapoint along the y axis.

Supported Data Sources

You can bind RadSparkline to a data source that implements one of the following interfaces:

Dim myLinearSparkline As New RadLinearSparkline()
Dim r As New Random()
Dim myData As New List(Of Double)()
For i As Integer = 0 To 19
myData.Add(r.Next(0,100))
Next i
myLinearSparkline.ItemsSource = myData

The result is shown below:

2.Binding To a List of Business Objects

If you have a list of business objects and you want to bind it to the RadSparkLine control here is how to do it:

Was this article helpful?

/

Give article feedback

Tell us how we can improve this article

Code samples are inaccurate / outdated.
I expected to find other / more information.
There are typos / broken links / broken page elements.
Content is inaccurate / outdated.
Other
By checking this box you consent to Progress contacting you by email about your response on this page.

Community

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 for appropriate markings.