You can do it in 2 ways:
1) loop thrue all rows in DataGridView
In pseudocode:
For i = 0 to DGV.Rows.Count-1
sum+=DGV.Rows[i].Item["Debit"].Value
Next
2) get sum from query
SELECT SUM(Debit) AS [SumOfDebit]
FROM TableName
WHERE condition
I don't know:
a) where you want to show it (in the last row of DGV or in the textboxes?),
b) the source of data (SQL Server, Access, etc.?)
If you provide more information, i'll improve my answer.