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

[Solved] Issue Re-rendering chart image after Datasource change

2 Answers 79 Views
RadControls
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Benjamin Zeinz
Top achievements
Rank 2
Benjamin Zeinz asked on 12 Jan 2010, 12:35 AM
I'm having issues re-rendering the radChart displayed in a web-part after the datasource SQL command has dynamically changed.

To make a web-parts more modular, I've succesfully spun the Databinding properties (DB connection string & SQL command query) off to the web.config file so that I can change the Data values, series names, even the number of series on the fly.
I have also spun simple properties like the chart title (radChart.ChartTitle.TextBlock.Text) to the web.config as well.

My issue is that whatever data source gets rendered the first time that I deploy seems to get stuck 90% of the time; Subsequent changes to the SQL command in the web-config do not seem to trigger a re-render of the chart-data. (either data values, number of series, or series names).
The issue is not a web.config read issue, as changing the Chart-title at the same time as I'm changing the data-source settings DOES result in the creation of a new .png file with the new Chart-title, but the old-data source chart.
Even stranger still, when I summarize the series data in a for-loop & append it to the chart title, the Web-part will render the correct/new data-source data summary into the Chart-title, but display the incorrect/old data-source data in the chart display.

It's like the web-part does realize that the Datasource and title info have changed, but doesn't re-render the chart, axis, or legend portions of the image, only the title-portion of the image. A few times the web-part will re-render on its own, but I have not been able to deduce what seems to jiggle the handle & force the chart-re-render. (I've tried IIS-Reset, web-part Redeployment, cache-deletion, server restart)

Any ideas? thank you in advance.
-Benjamin Zeinz
DMC - www.dmcinfo.com


2 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 12 Jan 2010, 05:11 PM
Are you calling RadChart1.DataBind() each time you change the data source? From your description it sounds like you only bind the data once, and subsequent changes are not being bound.
0
Benjamin Zeinz
Top achievements
Rank 2
answered on 12 Jan 2010, 05:34 PM
No, this is not a dynamic rebinding based on a user-action, this is a single simple chart getting drawn when the page is reloaded. When the web.config change is sensed on the page-reload it should(?) be re-running all of my code, including my only call to DataBind().




Process:
Web-part installed.
Original Data-source properties written to web-config.
web-part instance created & loaded; chart rendered correctly.
Data source & title properties in the web-config modified.
page reloaded; web-config change sensed & png image re-rendered; title with new data summary changed, chart image not changed & showing the old-data.

-Benjamin Zeinz
DMC - www.dmcinfo.com
Tags
RadControls
Asked by
Benjamin Zeinz
Top achievements
Rank 2
Answers by
Schlurk
Top achievements
Rank 2
Benjamin Zeinz
Top achievements
Rank 2
Share this question
or