Click here to Skip to main content
15,747,766 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using spread sheet

My user enter value in a column of sheet

and there is a textbox also where i calculate all record calculation.

I am not getting a way how to update textbox.

private void SetFormula_Circular()
        string[] strArr = new string[FpSpread1.ActiveSheetView.RowCount];
        string[] strArrsumAC = new string[FpSpread1.ActiveSheetView.RowCount];
        for (int i = 0; i < FpSpread1.ActiveSheetView.RowCount; i++)
            if (!string.IsNullOrEmpty(FpSpread1.ActiveSheetView.Cells[i, 7].Text))
                strArr[i] = FpSpread1.ActiveSheetView.Cells[i, 7].Text;
            if (!string.IsNullOrEmpty(FpSpread1.ActiveSheetView.Cells[i, 8].Text))
                strArrsumAC[i] = FpSpread1.ActiveSheetView.Cells[i, 8].Text.Replace("$","");
        decimal sumForecast_Cost = 0;
        for (int j = 0; j < strArr.Length; j++)
            sumForecast_Cost = sumForecast_Cost + Convert.ToDecimal(strArr[j]);
        txtProjectedCost.Text = Convert.ToString(sumForecast_Cost);
        decimal sumActualCost = 0;
        for (int j = 0; j < strArrsumAC.Length; j++)
            sumActualCost = sumActualCost + Convert.ToDecimal(strArrsumAC[j]);
        txtActualCost.Text = Convert.ToString(sumActualCost);

right now i am using this way.but it is not working

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900