RadControls for ASP.NET AJAX 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".
CopyC#
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();
CopyVB.NET
Dim ods As 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