SyntaxFix
Write A Post
Hire A Developer
Questions
It seems that it doesn't turn it into a string. Try
row.HeaderCell.Value = String.Format("{0}", row.Index + 1);