add this to the ItemDataBound event of the datagrid:
protected Sub dgTest_ItemBound(ByVal sender As Object, ByVal e As
DataGridItemEventArgs) Handles dgTest.ItemDataBound
If Not IsNothing(e.Item.DataItem) Then
Select Case e.Item.DataItem("TheColumn")
Case 1
e.Item.BackColor = Color.Aqua
Case 2
e.Item.BackColor = Color.Azure
End Select
End If
End Sub
Cheers
Cristian
"n" <> wrote in message
news:...
> I have a datagrid with many records, and i want to give specific color to
> rows (i have a boundcolum with value from 1 to 4 and i want green row
when
> the value is 1, red row when the value is 2 end so on...
>
> Any idea ?
>
>
|