Calculating the total of each column and display in footer of gridview in DataTable
#region column sum and show in footer



Before you start optimizing this block you should move it into a separate method. The region clearly indicates that it's a part of something bigger that is doing too much. I find it's pointless to try to optimize this as long as it's a region of something else.

Currently your method not only calculates the RowTotals but it also updates a grid-view. This should not be done by the same method because you cannot test whether the totals are calculated correctly. The only way to validate it is to look at the grid. This is very unreliable.

Basically it should look like this: you have two worker methods

int[] CalculateRowTotals(DataTable dataTable) { ... }

void UpdateTotalsGridView(int[] rowTotals) { ... }


and one method that combined the results of both:

void DisplayRowTotals(..)
{
    var rowTotals = CalcualteRowTotals(..);
    UpdateTotalsGridView(rowTotals);
}




About the code itself...


if(dt_.Rows.IndexOf(row) !=0)



It is not clear why you are doing this. A helper variable or method would be nice so that you can give it a meaning like I don't know isHeader or something that makes sense.