Sita Mahalakshmi

Sita Mahalakshmi

  • NA
  • 69
  • 1.1k

Formula Referenced Cells updation is not hitting column chan

Jun 6 2017 7:42 AM

I am implementing an Excel Add-in, in which the requirement is we have to download the data from the Service Layer and display it in the Excel sheet.The user can make some modifications to the data that is displayed in the excel. To track those events I'm using column change event of the data-table as i am using ado.net.

The problem I'm facing is in any one of the cell, I'm giving a formula, say for Example. I have 3 cells A1,B1,C1.

A1 contains 2. B1 contains 3. in C1 I'm giving the formula as =A1+B1, the cell is showing 5 and I'm able to get the value while I'm debugging.

But when I'm updating the cells of A1 & B1 to 5 and 6 the cell C1 is also getting changed but I'm unable to track it.

so, Need help.

Here is the code which I am using

web = new WebClient(); url = string.Format("{0}/DownloadData?parm1={1}&parm2={2}&parm3={3}", baseUrl, userName, _value);  string  response = web.DownloadString(url);  // converting the data to DataTable as the response is XML Format using (StringReader stringReader = new StringReader(response)) {     _dsDownloadData = new DataSet();     _dsDownloadData.ReadXml(stringReader);  } // I am using column changed event of DataTable to track the changes.  _dsDownloadData.Tables[1].ColumnChanged += new DataColumnChangeEventHandler(ProductRevenueData_ColumnChanged);  public static void ProductRevenueData_ColumnChanged(object sender, DataColumnChangeEventArgs e) { try { // Trying to track the changes here         clsProductUpdateXMLManager.Insert(e.Row, e.Column); } catch (Exception ex) { MessageBox.Show("Error", "Error-Window", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } }