A small case of thread necromancy, but I had the same problem, and I managed to fix it by aligning the code block, not the gridview itself.
Basically, I set the width of the element to 40% and leave it up to 30% (which means that the right is also 30%, since it's mathematics), and this positions the entire batch, text, grid and everything in the middle of the page.
Css looks something like this:
GridExample { position:absolute; left:30%; width:40%; padding:0; margin:0; }
source share