0
votes

I'm using the SPGridView in a custom page which has been deployed via SharePoint Designer. Now in 2007 everything worked fine but in 2010, the paging doesn't work and results in an error if you try and move to the next page so my question is;

When using custom code compiled for 2007 assemblies, does SharePoint use the 2007 controls (SPGridView) or does it perform some sort of redirect and try and use the 2010 controls? It's the only explanation I can think of that could be causing problems.

2
Infact after looking into it further I'm pretty sure that my code is being redirected to use the version 14 controls. Can I override this for this particular case? - sparkymark75

2 Answers

0
votes

The SPGridView is contained in the Microsoft.SharePoint.dll assembly (Microsoft.SharePoint.WebControls namespace).

Which version of the Microsoft.SharePoint.dll is installed on your server? If you are using a server with 2010 installed, you should read this MSDN post on how to redeploy customizations that were built for 2007 in 2010.

I strongly recommend that you don't try to use a different version of the SharePoint.dll just for that control, you will end up with a mess. Just build your code for 2010 using the article that I linked to and your paging should work fine.

0
votes

It was the DataKeyNames property that was causing the issue. When I removed that paging worked as expected.