I will add code samples if necessary, but I'm hoping someone else recognizes this problem and found a solution.
I am updating the filtering of an Asp.net DataView and then binding the chart to it, but it never refreshes with the new data.
I did get a client side script to do a repaint, and I can see it repaint after the DataBind, but still no new data results showing up.
Thanks in advance for any insight or help.
-Rick
I am updating the filtering of an Asp.net DataView and then binding the chart to it, but it never refreshes with the new data.
I did get a client side script to do a repaint, and I can see it repaint after the DataBind, but still no new data results showing up.
Thanks in advance for any insight or help.
-Rick
4 Answers, 1 is accepted
0
Hello Rick,
It may be possible that you are changing the chart's data source with an ajax request, but the chart itself is not ajaxified. I would suggest the following:
- Examine your AJAX settings for any inconsistencies.
- See whether there are any JavaScript errors on you page.
Without having the exact scenario that reproduces the problem it would be hard to say what is causing it. Therefore if you do not find helpful the above information it would be better to provide us a small fully runnable sample that reproduces the issue, so we can investigate it further.
Regards,
Danail Vasilev
Telerik
It may be possible that you are changing the chart's data source with an ajax request, but the chart itself is not ajaxified. I would suggest the following:
- Examine your AJAX settings for any inconsistencies.
- See whether there are any JavaScript errors on you page.
Without having the exact scenario that reproduces the problem it would be hard to say what is causing it. Therefore if you do not find helpful the above information it would be better to provide us a small fully runnable sample that reproduces the issue, so we can investigate it further.
Regards,
Danail Vasilev
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Richard
Top achievements
Rank 1
answered on 29 Jan 2015, 05:12 PM
Thank you for the quick response.
A self contained buildable example is problematic for me at this time, but I will do my best to explain and provide some code snippets.
I am changing the data source in C# code behind like this:
dtLatencyTimelineTable is created by using the DataView with the filtering applied to calculate the values used in the chart.
This works when I do a complete query to an SQL db into a DataTable, then save it into the ASP cache like this:
(dt is the DataTable from the query, and is a static on the page to preserve contents, slSelectedDevices is a string list)
What is not working is when I change the filtering using the above sampe code without doing a whole new query. Other controls, both ASP GridView, refresh with the filtered data just fine using similar assignment of DataSource and DataBind, it is only my Telerik charts which do not.
I tried using a RadAjaxManager like this:
RadAjaxPanel1 contains the RadHtmlChart, and FiltersAjaxPanel is a RadAjaxPanel containing the ASP button and textboxes used to define the filtering and then refresh the UI with the filtered data.
This successfully triggers the repaint for the RadHtmleChart via a javascript function inside my RadCodeBlock, but the data is not updated to reflect the changes from the filtering.
So, in review the problem is:
With a completely new query from SQL to a DataTable, then using and filtering a DataView, all the UI updates, including ASP gridviews and my RadHtmlChart.
If I use the existing DataTable after the initial query, and refresh the DataView filtering, my ASP gridviews update with new data as expected, but my RadHtmlChart does not.
Thank you in advance for any attention you may give to my problem, all insight or assistance is appreciated.
-Rick
A self contained buildable example is problematic for me at this time, but I will do my best to explain and provide some code snippets.
I am changing the data source in C# code behind like this:
RadHtmlUpdateLoadTimeLineChart.DataSource = dtLatencyTimelineTable;<br> RadHtmlUpdateLoadTimeLineChart.DataBind();
dtLatencyTimelineTable is created by using the DataView with the filtering applied to calculate the values used in the chart.
This works when I do a complete query to an SQL db into a DataTable, then save it into the ASP cache like this:
(dt is the DataTable from the query, and is a static on the page to preserve contents, slSelectedDevices is a string list)
IEnumerable<DataRow> dataRowsQuery =<br> from order
in
dt.AsEnumerable()<br> where (slSelectedDevices.Contains(order.Field<
string
>(
"ID"
)))<br> select order;<br><br>DataTable newDataTable = dataRowsQuery.CopyToDataTable<DataRow>();<br><br> DataView dvSelectedDevices =
new
DataView();<br><br>dvSelectedDevices = newDataTable.AsDataView();<br><br>FilterDataView(dvSelectedDevices);
//applies filtering per UI input.<br><br>Cache["ViewData"] = dvSelectedDevices; <br><br>
I tried using a RadAjaxManager like this:
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
ClientEvents
OnResponseEnd
=
"MyFunction"
/>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"FiltersAjaxPanel"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RadAjaxPanel1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
RadAjaxPanel1 contains the RadHtmlChart, and FiltersAjaxPanel is a RadAjaxPanel containing the ASP button and textboxes used to define the filtering and then refresh the UI with the filtered data.
This successfully triggers the repaint for the RadHtmleChart via a javascript function inside my RadCodeBlock, but the data is not updated to reflect the changes from the filtering.
So, in review the problem is:
With a completely new query from SQL to a DataTable, then using and filtering a DataView, all the UI updates, including ASP gridviews and my RadHtmlChart.
If I use the existing DataTable after the initial query, and refresh the DataView filtering, my ASP gridviews update with new data as expected, but my RadHtmlChart does not.
Thank you in advance for any attention you may give to my problem, all insight or assistance is appreciated.
-Rick
0
Richard
Top achievements
Rank 1
answered on 29 Jan 2015, 09:52 PM
I have found a solution, but I'm not sure why it worked or is necessary, maybe you could help me understand.
I moved the ASP button which starts the filter refresh out of the RadAjaxPanel it was inside. In fact I took my whole filtering UI including a listbox and some textboxes for inputing min and max filtering values outside of any update panel, ASP or Telerik.
This makes sure the whole page updates and now my RadHtmlCharts are updating after the filter refresh.
I still think there must be way to let either the RadHtmlChart or the RadAjaxPanel it is inside know it needs to refresh with the new data binding, I just have not been able to discover what it is yet.
Thanks again for your attention,
-Rick
I moved the ASP button which starts the filter refresh out of the RadAjaxPanel it was inside. In fact I took my whole filtering UI including a listbox and some textboxes for inputing min and max filtering values outside of any update panel, ASP or Telerik.
This makes sure the whole page updates and now my RadHtmlCharts are updating after the filter refresh.
I still think there must be way to let either the RadHtmlChart or the RadAjaxPanel it is inside know it needs to refresh with the new data binding, I just have not been able to discover what it is yet.
Thanks again for your attention,
-Rick
0
Accepted
Hello Richard,
Using RadAjaxPanel simultaneously with RadAjaxManager or UpdatePanel ( or implementing multiple wrapped RadAjaxPanels ) is not a supported scenario and we highly recommend to avoid such implementation. Please either use just the manager to update your controls replacing the UpdatePanel / RadAjaxPanel with a regular asp:Panel, or use the UpdatePanel / RadAjaxPanel alone to wrap your page.
Regards,
Danail Vasilev
Telerik
Using RadAjaxPanel simultaneously with RadAjaxManager or UpdatePanel ( or implementing multiple wrapped RadAjaxPanels ) is not a supported scenario and we highly recommend to avoid such implementation. Please either use just the manager to update your controls replacing the UpdatePanel / RadAjaxPanel with a regular asp:Panel, or use the UpdatePanel / RadAjaxPanel alone to wrap your page.
Regards,
Danail Vasilev
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.