当我将此代码添加到我的方法时,我的当前单元格已更改并转到当前行的最后一列
decimal value = 0;
var flag = decimal.TryParse(Dgv_ProjectSeason.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(), out value);
if (flag)
{
SetPercentOfValue(Convert.ToDecimal(value));
}
和方法SetPercentOfValue
是
private void SetPercentOfValue(decimal value)
{
Txt_DepositPrice.Text = Math.Round(((decimal.Parse(Txt_DepositPercent.Text) / 100) * value)).ToString();
Txt_ContractorInsurancePrice.Text = Math.Round(((decimal.Parse(Txt_ContractorInsurancePercent.Text) / 100) * value)).ToString();
Txt_EmployerInsurancePrice.Text = Math.Round(((decimal.Parse(Txt_EmployerInsurancePercent.Text) / 100) * value)).ToString();
Txt_ForceTaxPrice.Text = Math.Round(((decimal.Parse(Txt_ForceTaxPercent.Text) / 100) * value)).ToString();
Txt_IncreaseValueTaxPrice.Text = Math.Round(((decimal.Parse(Txt_IncreaseValueTaxPercent.Text) / 100) * value)).ToString();
}
我必须使用这种方法。我该如何解决?