This post would depict the simple usage of SPGridView and reading from a list and binding it to the SPGridView programatically.
SPGridView oSPGridView = new SPGridView();
string sTaskListName = "News"; // News List in this example
SPWeb site = SPControl.GetContextWeb(Context);
SPList spList = site.Lists[sTaskListName];
SPDataSource mySPDS = new SPDataSource();
mySPDS.List = spList;
oSPGridView.DataSource = mySPDS;