RadChart Click event causes js error with 0 records

Thread is closed for posting
5 posts, 0 answers
  1. Kim
    Kim avatar
    6 posts
    Member since:
    May 2009

    Posted 31 Aug 2009 Link to this post

    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?

  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 02 Sep 2009 Link to this post

    Hello Kim,

    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.
  3. Kim
    Kim avatar
    6 posts
    Member since:
    May 2009

    Posted 02 Sep 2009 Link to this post

    Thanks for the tip... now I can see the actual error. Unfortunately, I'm still confused. Here is the detailed error. Any other ideas?


    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:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Telerik.Charting.RenderedObject.GetOrder() +11
       Telerik.Charting.MapAreaBuilderBase.GetPath(IOrdering element, ArrayList list) +29
       Telerik.Charting.MapAreaBuilderBase.AddImageMap(IOrdering elem, StringBuilder html, Boolean makeTooltipOnly) +164
       Telerik.Charting.MapAreaBuilderBase.GenerateImageMap(IContainer container) +2794
       Telerik.Web.UI.MapAreaBuilder.GenerateImageMap() +14
       Telerik.Web.UI.RadChart.RenderClassic(HtmlTextWriter writer) +798
       Telerik.Web.UI.RadChart.RenderContents(HtmlTextWriter writer) +208
       System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
       Telerik.Web.UI.RadDataBoundControl.Render(HtmlTextWriter writer) +12
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Control.Render(HtmlTextWriter writer) +10
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriter writer) +234
       System.Web.UI.Control.Render(HtmlTextWriter writer) +10
       System.Web.UI.UpdatePanel.Render(HtmlTextWriter writer) +34
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Control.Render(HtmlTextWriter writer) +10
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163
       System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
       System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Control.Render(HtmlTextWriter writer) +10
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
       System.Web.UI.Page.Render(HtmlTextWriter writer) +29
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266
    
  4. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 03 Sep 2009 Link to this post

    Hello Kim,

    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.
  5. Kim
    Kim avatar
    6 posts
    Member since:
    May 2009

    Posted 03 Sep 2009 Link to this post

    I submitted a support ticket but I would like to state that the problem seems to be a combination of 3 things:

    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.
Back to Top