Hi,
say in ItemDataBound event handler for the grid you could change the
properties of the DataGridItem (current item being databound). The item is
given in the second event argument of type DataGridItemEve ntArgs for the
event handler method.
Say:
Public Sub MyGrid_ItemData Bound(sender As Object,e As DataGridItemEve ntArgs)
Handles MyGrid.ItemData Bound
If e.Item.ItemType ==ListItemType. Item OrElse
e.Item.ItemType ==ListItemType. AlternatingItem Then
If [somethingevalua tedhere] Then
e.Item.BackColo r=Color.Red
End If
End If
End Sub
The DataGridItem represents the current row (item) as a whole and changing
its properties as I changed BackColor in the example (when condition
matches), you can customize it as you like.
--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"James Lennon" <an*******@disc ussions.microso ft.com> wrote in message
news:02******** *************** *****@phx.gbl.. .
How can I customize a DataGrid row based on the row
properties. For istance if a column is 0 make the row
bold or red. I have only been able to format a datagrid
based on columns.
James