I'm not sure if the following will work for a GridView, but it works for a DataGrid:
If you'd rather not build the whole DataGrid by hand, prefering to let VS2005 do the grunt work with the drag'n'drop it does so well, but want to adjust a dataGridItem's attributes conditionally, you can do that as well.
For example, say you're displaying ProductName, UnitPrice and UnitsInStock from the Products table of the Northwind database in a DataGrid. You want to change the text color of the cells to gray if the Discontinued field is true, and you want to change the background color of the item's row cells to red if the UnitsInStock is less than 10 as a visual cue to the operator to reorder more of those units.
So, with your datagrid (dgProducts) built on the web page into BoundColumns whose DataFields are ProductName, UnitPrice and UnitsInStock (in that order) and with Discontinued loaded into a fourth BoundColumn (hidden with Visible="false"), you can make those individual changes in the sub that loads your data, immediately after you bind the dataset to the grid's datasource, as follows:
dgProducts.DataSource = ds
dgProducts.DataBind()
Dim itm As DataGridItem
For Each itm In dgProducts
If itm.Cells(3).Text = False Then
itm.Cells(0).ForeColor = Drawing.Color.Gray
itm.Cells(1).ForeColor = Drawing.Color.Gray
itm.Cells(2).ForeColor = Drawing.Color.Gray
End If
If CInt(itm.Cells(2).Text) < 10 Then
itm.Cells(2).BackColor = Drawing.Color.Red
End If
Next
I don't know how useful that is to anyone else, but it sure helped me. I'll have to play around and see if there's a way to do this with a GridView; so far I haven't found the DataView's equivalent to a DataGridItem.