This is a migrated thread and some comments may be shown as answers.

How to programatically set datasource for graph

1 Answer 195 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nic
Top achievements
Rank 1
Nic asked on 14 May 2015, 01:41 PM

How do I programmatically set the datasource for a graph? I've created the NeedDataSource event handler and it gets called but I cannot work out how to cast the sender in order to set the datasource:

void graph1_NeedDataSource(object sender, EventArgs e)
{
                (sender as Telerik.Reporting.Processing.?).DataSource = GetGraphData();

I've tried casting to a Telerik.Reporting.Processing.Chart and a Telerik.Reporting.Processing.DataItem both of which do not work. The object appears to be a Telerik.Reporting.Processing.Graph but that is not accessible.

 

TIA

Nic

 

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 18 May 2015, 04:09 PM
Hello Nic,

The Graph item should be cast to a Processing.DataItem:
(sender as Telerik.Reporting.Processing.DataItem).DataSource = GetGraphData();

You can find additional information on the topic in your support thread for the same issue.

Regards,
Nasko
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Nic
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or