gridView_DataBindingComplete事件中的StackOverFlow异常

时间:2013-06-01 10:15:08

标签: c# windows

当我运行以下代码时,我得到了StackOverFlow异常。请为此提供解决方案。

private void gridView_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
    {
        double percentageOfProfit = 0.00;
        if (gridView.Columns.Contains("TotalAmountPayable"))
        {
            foreach (DataGridViewRow row in gridView.Rows)
            {
                if (row.Cells["PercentageOfProfit"].Value.ToString() != "")
                {
                    percentageOfProfit = Convert.ToDouble(row.Cells["PercentageOfProfit"].Value);
                    row.Cells["AmountPayableToBeneficiary"].Value = totalRevenuePaid * (percentageOfProfit / 100.00);
                    row.Cells["TotalAmountPayable"].Value = totalRevenuePaid;
                }
            }
        }
    }

0 个答案:

没有答案