S
simon
I have dataGrid.
I would like that item background(row of the dataGrid) is red if the active
field in database is false
otherwise leave it like it is.
I tried like this:
<asp
ataGrid ItemStyle-BackColor='<%#
checkActive(DataBinder.Eval(Container.DataItem, "active"))%>'>
and in code behind:
Public Function checkActive(ByVal vrednost As Boolean) As Color
If vrednost = False Then
PreveriAktivnost = System.Drawing.Color.Red
End If
End Function
I get an error message:
'DataItem' is not a member of 'System.Web.UI.Control'.
How can I solve this problem? Maybe onItemCreated and check there?
Thank you,
Simon
I would like that item background(row of the dataGrid) is red if the active
field in database is false
otherwise leave it like it is.
I tried like this:
<asp

checkActive(DataBinder.Eval(Container.DataItem, "active"))%>'>
and in code behind:
Public Function checkActive(ByVal vrednost As Boolean) As Color
If vrednost = False Then
PreveriAktivnost = System.Drawing.Color.Red
End If
End Function
I get an error message:
'DataItem' is not a member of 'System.Web.UI.Control'.
How can I solve this problem? Maybe onItemCreated and check there?
Thank you,
Simon