I recently had the task of working on a leaderboard for a project at work. I used ASP.NET for the project and found I was having problems getting the rank to work correctly when the gridview went to the next page of results.
To correct this, I hooked into the GridView.PageIndexChanging event.