Not sure of if you are talking of Windows app or Web app.
In either case, you need to traverse row-wise data present in grid. get the column values and add them up.
Ex in web:
int total = 0;
protected void DataGrid_ItemDataBound(object sender, DataGridItemEventArgs e)
{
Textbox tbx = (TextBox)e.Row.FindControl("column2textbox");
if (tbx != null)
{
}
}