I have a Chart inside an UpdatePanel that is bound to a SqlDataSource. Outside the UpdatePanel, I have a dropdownlist. The SqlDataSource uses the selected value of the drop down list as a control parameter when selecting data that is used in the chart. By itself, this setup is working great. When I change the drop down list value, the chart updates. If the SqlDataSource returns 0 records, the chart shows the EmptySeriesMessage
However, I tried adding a Click event in the code behind. This is all I added:
Protected Sub RadChart1_Click(ByVal sender As Object, ByVal args As Telerik.Charting.ChartClickEventArgs) Handles
End Sub
Now when I change the selected item in the drop down list, everything works fine, but only if there SqlDataSource returns results. If the SqlDataSource has 0 results, then I get a JavaScript error and the chart does not update. The javascript error is PageRequestManagerServerErrorException Object reference not set to an instance of an object.
Can anyone help me? Is this a bug with the RadChart?
4 Answers, 1 is accepted
We are unable to reproduce such problem in our local tests and we are unsure that it is related to the control itself. The JavaScript exception you are receiving is a server-side exception wrapped by the ASP.NET AJAX ScriptManager -- you can try setting the ScriptManager.EnablePartialRendering property to false, and then run the application in debug mode to see where the server-side exception originates in the first place.
Regards,
Manuel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
|
Could you open a formal support ticket and send us a runnable sample application that demonstrates the problem (or at least could you provide us with more guidelines and code how to observe the issue here) so we can advise you properly how to proceed.
Looking forward to your reply.
Best wishes,
Manuel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
1. binding a chart to an empty dataset
2. adding a ChartMarkedZone to the PlotArea
3. having a RadChart Click event
As a workaround for my project, I'm going to check for an empty dataset before adding the zone.