sagar mhaske

sagar mhaske

  • NA
  • 1
  • 646

I want calculation of next cell when i click in first cell

Oct 2 2015 3:23 AM
i want calculation of next cell when enter on  first cell in datagridview
 
 
private void gvExpensesTaxses_CellEnter(object sender, DataGridViewCellEventArgs e)
{
decimal per;
decimal tamt;
foreach (DataGridViewRow row in gvExpensesTaxses.Rows)
{
per=Convert.ToDecimal(row.Cells["%(Per)"].Value);
tamt=Convert.ToDecimal(txtTotalAmt.Text);
decimal t =Convert.ToDecimal(tamt) / 100 * Convert.ToDecimal(per);
row.Cells["Amt"].Value = Convert.ToDecimal(t).ToString();
}
}
 
I get erroe like'Input string was not in a correct format.' 
in this line Plz help me ........................................... 
per=Convert.ToDecimal(row.Cells["%(Per)"].Value);