Today i tried to use SPGridView in my sandbox project. Unfortunately this is not possible. I stumbled over Steve Clements Blog providing a workaround for this. Use GridView and copy some styles that the control looks like a SPGridView.
So here is a page from Microsoft about Restrictions on Sandboxed Solutions in SharePoint 2010 what works in sandboxed solutions and what not.
Unfortunately the namespace: Microsoft.SharePoint.WebControls is not allowed in sandboxed solutions.