Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1537
  • Last Modified:

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

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.

conStockSelect.Open();
            grdExceptions.SelectedValue.ToString();
            cmd.Parameters.Clear();
            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();
            dscExceptionDetail.DataBind();
            // the chart does not change.
            //dscExceptionDetail is the datasource for Series1 of Chart2
            //Refresh the chart based on the new cmd parameter values
            // ????
0
Dovberman
Asked:
Dovberman
1 Solution
 
Praveen VenuTechnical Project ManagerCommented:
Try to call the Refresh() of the Chart Control
0
 
DovbermanAuthor Commented:
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.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now