How to refresh the ASP: Chart when the datasource for the chart series is modified.

Posted on 2009-02-22
Last Modified: 2012-05-06
This should be simple, but I am stuck.

I have a MS NET chart control whose series is based on a datasource.

I am resetting the datasource parameters.
then I would like the chart to redraw based on the datasource.

            cmd.Parameters.Add("@FromDate", SqlDbType.DateTime).Value = strFromDate;
            cmd.Parameters.Add("@ToDate", SqlDbType.DateTime).Value = strToDate;
            cmd.Parameters.Add("@SymbolID", SqlDbType.Int).Value = grdExceptions.SelectedValue.ToString();
            // the chart does not change.
            //dscExceptionDetail is the datasource for Series1 of Chart2
            //Refresh the chart based on the new cmd parameter values
            // ????
Question by:Dovberman
    LVL 15

    Expert Comment

    by:Praveen Venu
    Try to call the Refresh() of the Chart Control

    Accepted Solution

    The Microsoft NET Chart Control does not have the Refresh method that is documented in the help file.
    I did find that databinding the datasource used by the Chart does the trick.

    My obstacle now is that the only way I can reset the parameter values is comment out the parameters in the stored procedure, hard code the stored procedure, set the CommandType property of the DataSource to "Text" and modify the DataSource SelectCommand in code.

    I need to find out how to modify the DataSource SelectionParameters.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now