Hi,
For e.g your data GridView Cotains two columns "Value1" and "Value2" that are fetched from database Your filled data into a temp DataTable and add an extra column into the temp Data table its name "Sum".
In this case ur trying to add the both value into sum coulmn. Here is code that fullfill ur requirement.
foreach (DataGridViewRow drRow in this.testDataGridView.Rows)
{
// Add the values of first two columns and assinged them to new created
// temp column into data Grid.
drRow.Cells[2].Value = Convert.ToInt32(drRow.Cells[0].Value.ToString()) + Convert.ToInt32(drRow.Cells[1].Value.ToString());
}
Good luck.