次のコードを実行すると、StackOverFlow Exception が発生します。これに対する解決策を提供してください。
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;
}
}
}
}