In order to show the total in the footer of the gridview you need to add the FooterTemplate in your gridview markup code. Then only your "if" condition will be for checking the rowtype as footer will match "if (e.Row.RowType == DataControlRowType.Footer)".
PS: Also, you need to change the total calculation- if rowtype is DataRow not Footer as you are doing currently.
You can refer the below link
Display sum of columns total in gridview footer in asp.net[
^]
Hope this helps ...
[Edit member="Tadit"]
Link text added to reflect the Article/QA title.
Corrected formatting and grammatical issues.
[/Edit]