I’ve been meaning to blog this for a while so here goes. Recently I was working on a web part which contained an SPGridView. The SPGridView had been setup to allow paging but when I deployed the web part the paging controls would not display.
Eventually after some playing around I found out you need to set the PagerTemplate to null (if you are not using a custom one) after you have added the grid to the controls collection. If you set the PagerTemplate before adding the grid to the controls collection then the paging controls will not display.
[code lang="csharp"]myGrid.PagerSettings.Mode = PagerButtons.NumericFirstLast;
myGrid.PageIndexChanging += new GridViewPageEventHandler(claimsGrid_PageIndexChanging);
claimsGrid.PagerTemplate = null; [/code]
Hope this helps