J
Joe
Hi,
I am attempting to highlight rows in my datalist based on a
value in the database. My event handler is shown below:
Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.DataListItemEventArgs) Handles
DataList1.ItemDataBound
Dim Discontinued As Boolean = (CType(e.Item.DataItem,
DataRowView)).Row.ItemArray(2).ToString()
If Discontinued = True Then
DataList1.ItemStyle.BackColor = Drawing.Color.Yellow
Else
DataList1.ItemStyle.BackColor = Drawing.Color.White
End If
End Sub
It compiles and runs fine, and the Discontinued value is the
correct value when I run it through the debugger - but the BackColor
does not change.
Can anyone tell me what I am doing wrong in setting the
BackColor?
Thanks,
J
I am attempting to highlight rows in my datalist based on a
value in the database. My event handler is shown below:
Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.DataListItemEventArgs) Handles
DataList1.ItemDataBound
Dim Discontinued As Boolean = (CType(e.Item.DataItem,
DataRowView)).Row.ItemArray(2).ToString()
If Discontinued = True Then
DataList1.ItemStyle.BackColor = Drawing.Color.Yellow
Else
DataList1.ItemStyle.BackColor = Drawing.Color.White
End If
End Sub
It compiles and runs fine, and the Discontinued value is the
correct value when I run it through the debugger - but the BackColor
does not change.
Can anyone tell me what I am doing wrong in setting the
BackColor?
Thanks,
J