- Posted by justin on March 8, 2007
I ran into a problem with a GridView with custom paging throwing a arithmetic overflow error when I click on the Last pager button. It turns out for whatever reason, Microsoft stores the GridView's total page count in viewstate instead of the control state like the rest of the GridView properties. Luckily it is really easy to work around this issue. All you need to do is change the Last pager button's command argument in the code-behind to the GridView.PageCount property and the error goes away.