This topic is locked

Change the background Color of a List Page Row in v4.1

4/17/2007 5:29:50 PM
ASPRunnerPro General questions
G
gverras author

I'm posting this because it's a little different from some of the other posts that I've read. My apologies if this is redundant.

I needed to change the background color of a row in v4.1.

I had to modify the list page and I added a new class to include/style.css
First the list page:

Near the bottom of the list page where the row gets inserted into the Dictionary
Originally it looked like:

...

while not rs.eof and recno<=PageSize

Set row = CreateObject("Scripting.Dictionary")

if not shade then

row.Add "shadeclass","class=""shade"""

row.Add "shadeclassname","shade"

shade=true

else

row.Add "shadeclass",""

row.Add "shadeclassname",""

shade=false

end if
col=0

while not rs.EOF and recno<=PageSize and col<1
...
Now it looks like:

I tested on a value for a column in that row and inserted my own class.

...

while not rs.eof and recno<=PageSize

Set row = CreateObject("Scripting.Dictionary")

' Custom Code

' Test for a non-client and change the backgound

If GetData(rs,"PartyLienType", "") = "Non-Client" then
row.Add "shadeclass","class=""nonclient"""

row.Add "shadeclassname","nonclient"
else
if not shade then

row.Add "shadeclass","class=""shade"""

row.Add "shadeclassname","shade"

shade=true

else

row.Add "shadeclass",""

row.Add "shadeclassname",""

shade=false

end if

end if

col=0

while not rs.EOF and recno<=PageSize and col<1

...
2. I added this to style.css
.nonclient

{

COLOR: black;

BACKGROUND-COLOR: palegreen

}
Works like a charm.

Sergey Kornilov admin 4/19/2007

George,
thank you for sharing this!
We plan to add BeforeMoveNext event that will be called right before each row is displayed. You'll be able to modify background color in this event.