On Apr 22, 11:32*pm, DavidC <dlch...@lifetimeinc.com> wrote:
> I have an asp.net listView that I want to change the background color based
> on a condition. *I have started to do something in the ItemDataBound event
> but cannot find out what method or ??? to use to assign a background color. *
> I have done this in a GridView but this is the first I have tried in
> ListView. *Below is my code if someone can help. *Thanks.
>
> * * Protected Sub lvPTODetails_ItemDataBound(ByVal sender As Object, ByVal e
> As System.Web.UI.WebControls.ListViewItemEventArgs) Handles
> lvPTODetails.ItemDataBound
> * * * * Dim dataItem As ListViewDataItem = CType(e.Item, ListViewDataItem)
> * * * * Dim rowView As DataRowView = CType(dataItem.DataItem, DataRowView)
> * * * * ' Retrieve the Vendor value for the current item.
> * * * * Dim dblAvailable As Double =
> Convert.ToDouble(rowView("UnitsAvailable"))
> * * * * If dblAvailable <> 0 Then
> * * * * * * 'do something here to change background color
> * * * * End If
> * * End Sub
>
> --
> David
http://www.microsoft.com/communities...&cr=&sloc=&p=1