New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Binding to ObjectDataSource at Run-Time

Updated over 6 months ago

RadChart has been deprecated since Q3 2014 and is no longer recommended for use, as it does not support modern browsers. We strongly recommend using RadHtmlChart, Telerik's modern client-side charting component. To transition from RadChart to RadHtmlChart, refer to the following migration articles:

Explore the RadHtmlChart documentation and online demos to determine how it fits your development needs.

Once a business object with appropriate attributes has been created you can bind to it in code at run-time. The steps are:

The code below demonstrates binding to an ObjectDataSource that consumes an example object defined in the topic "Creating an Object that can be consumed by ObjectDataSource".

C#
ObjectDataSource ods = new ObjectDataSource();
ods.SelectMethod = "GetProducts";
ods.TypeName = "RadChartBinding.ProductsBO";
RadChart1.DataSource = ods.Select();
RadChart1.Series[0].DataYColumn = "QuantityInStock";
RadChart1.PlotArea.XAxis.DataLabelsColumn = "Name";
RadChart1.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font = new System.Drawing.Font("Arial", 8);

RadChart1.DataBind();			

See Also

In this article
See Also
Not finding the help you need?
Contact Support