First off, everyone should read this article, it is roughly 15 parts and it goes into great detail about the datagrid, and what you can program it to do. I have printed the entire article and use it as a reference at my desk.
You can read the row values one of two ways, either by iterating through the rows and performing some action on the data or when the dataset is bound to the grid by programming the Datagrid_itemdatabound event. I have included code for both of these methods.
First lets just look at the dataset and iterate throught the rows.
---------------------------------------------------------
Dim oDs As Data.DataSet
Dim ssql as String = "Select * from Pubs"
'get the data into the dataset
oDs = tpapp.GenericDataset(ssql)' this gets a dataset
If oDs.Tables(0).Rows.Count > 0 Then
Dim drDataRow As Data.DataRow
For Each drDataRow In oDs.Tables(0).Rows
' do something usefull with the data
Response.Write(drDataRow.ItemArray(0))
Response.Write(drDataRow.ItemArray(1))
Next
End If
---------------------------------------------------------
now lets look at how we can program the datagrid_itemdatbaound event
---------------------------------------------------------
Sub dgStoreSupport_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgStoreSupport.ItemDataBound
Select Case e.Item.ItemType
Case ListItemType.AlternatingItem, ListItemType.Item
'See if we have a new header
Dim lbltext As Label = CType(e.Item.Cells.Item(3).FindControl("lblPhNUmber"

, Label)
If lbltext.Text.Equals("NewHead"

Then
'Format the data, then align the text of the cells to the left
'remove the 2 right cells
e.Item.Cells.RemoveAt(3)
e.Item.Cells.RemoveAt(2)
'set the cell colspan=2
e.Item.Cells(1).ColumnSpan = 2
' turn the edit button off (i hope

)
e.Item.Cells.Item(0).FindControl("Button1"

.Visible = False
'align the cell to the left, set the ext to bold and set the bgcolor
e.Item.Cells(1).Attributes.Add("align", "left"

e.Item.Cells(1).Font.Bold = True
e.Item.Cells(1).Font.Underline = True
e.Item.BackColor = Color.FromArgb(204, 204, 255)
End If
If Session("ISGroup"

<> "True" Then 'User is not able to edit remove the controls
e.Item.Cells.Item(0).FindControl("Button1"

.Visible = False
End If
Case ListItemType.Footer
If Session("ISGroup"

<> "True" Then
' remove all the the controls, lets try to first make the footer invisable
Dim x As Integer
For x = 0 To 4
e.Item.Cells(x).Visible = False
Next
End If
End Select
End Sub
---------------------------------------------------------
hope this helps
George Oakes
Goakes@TiresPlus.com = Programmer
George@1-Specialday.com = Mobile DJ
Check out this awsome .Net Resource!