在离开事件时计算FpSpread上的文本框值 [英] calculate textbox value on FpSpread on leave event
本文介绍了在离开事件时计算FpSpread上的文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用spread.net电子表格
我的用户在一列表格中输入值
并且还有一个文本框,我计算所有记录计算。
我没有办法更新文本框。
I am using spread.net 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
推荐答案
, );
}
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);
}
",""); } 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
这篇关于在离开事件时计算FpSpread上的文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文