Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 14th, 2008, 08:44 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default Datalist Row Color

I want to color the rows in a datalist depending upon the data values from the SQL query. I have no problem doing this in a datagrid databound using e.Item.cssclass but it seems to have no effect in the datalist.

This IF statement is within the Item_DataBound for the datalist. Everything else within the IF is working except for the e.Item.cssclass. I've tried removing all of the cssclass calls on the front page but that didn't do any good either.

Appreciate your time and input. Thank you.

If oDS.Tables(0).Rows(0).Item("HistStatus") = 0 Then
 chkLeakBit1.Enabled = False
 chkLeakBit2.Enabled = False
 chkLeakBit3.Enabled = False
 txtLeakFloat1.Enabled = False
 txtLeakFloat2.Enabled = False
 lbOutOfService.Visible = True
 lbOutOfService.Text = " - Out Of Service"
 e.Item.CssClass = "tva_item_darkgray"
Else
 lbOutOfService.Visible = False
 lbOutOfService.Text = ""
End If






Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i change row color in datagrid? berzegerol VS.NET 2002/2003 3 October 31st, 2006 09:08 AM
datagrid row color change berzegerol Visual Studio 2005 0 October 18th, 2006 06:33 AM
DataGrid row back color related to datalist id's jgd ASP.NET 2.0 Basics 0 May 4th, 2006 09:21 AM
change row color vivek_pon VS.NET 2002/2003 3 April 13th, 2006 01:42 PM
changing datagrid row color msrnivas Classic ASP Components 4 August 5th, 2004 10:58 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.