Instead of doing the sum in the datagridview, you can do that in the datasource you are using to bind the datagrid.
For example, if you are using datatable as the source for binding datagrid then you can find the sum doing something like-
double total = 0;
foreach (var myRow in myTable)
{
total += double.Parse(myRow["MyValue"].ToString());
}
To get back the datatable at some other place than the binding datagrid, you write something like-
Datatable dt = (Datatable) myDatagrid.ItemsSource;
Hope, it helps :)