ok, took your example and tryed this:
ForeColor='<%#testforsold(Eval("stock")) %>'
and :
Public Function testforsold(ByVal stock As String) As String
If stock = "Sold" Then
Return "#f03439"
Else
Return "#FF0000"
End If
End Function
i get an error saying cant convert to system.drawing.color
i almost wanna say change the As sting to as system.drawing.color
but not sure.