SPGridView supports the Cascading Style Sheets built into WSS. You can present data in a grid view that closely resembles the view that SharePoint uses to display data from lists. You can also sort and group rows.
This class does not support auto-generated columns. That means you must explicitly bind each column using SPBoundField. You can do this by creating an ADO.NET DataTable or by using a query object that return an ADO.NET DataTable object, such as an SPSiteDataQuery object.
Note Make sure to set AutoGenerateColumns=false. If you set AutoGenerateColumns=true an exception will be thrown.