CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 CCS: How to create alternate grid row colors?

Print topic Send  topic

Author Message
Brent
Posted: 06/03/2002, 9:44 AM

I have a grid using a style and I would like to alternate the row colors
for the data portion of the grid. I thought I could find a Class under Style
properties window for the alternate data row. I thought it was CaravanAltDataTD
but changing that color changes the color for all data rows. Is there a way to
establish alternate grid row colors? I know I can do this with the power wizard
but how do you do it after the form has been created?

Also, how do I activate a record separator between the rows if the current style
doesn't have one? TIA

Brent
Alex Alexapolsky
Posted: 06/04/2002, 2:59 AM

Refer to
http://gotocode.com/art.asp?art_id=183&
Brent
Posted: 06/08/2002, 10:02 PM

Alex,
Alex, thanks that worked. :)

But the ability to add alternate colors and a separator to the grid should
be made available with a couple of check boxes in the Grid format properties. This
capability will be used a lot (especially once the client sees it). To try and
do this by hand for all existing grids in an application could be quite a bit
of work.

Also the PowerWizard for building a single page should also have checkboxes
for these options when building grids.

Brent
feha
Posted: 06/09/2002, 1:18 AM

This is a PHP example I'm using it at:
http://www.vision.to/links/Default.php



Code Snipet:
----------------------------------------------------

if ($alternate == "1")
{$bg_color = "#FFFFFF";$alternate = "2";}
else
{$bg_color = "#E9E9E9";$alternate = "1";}


echo "<tr><td class=signalcell bgcolor=".$bg_color." ...


-------------------------------------------------------

Regards
feha
[www.vision.to]
Brent
Posted: 06/09/2002, 10:24 AM

feha,
Thanks for the code snippet. I will file it away for future use. :)
There is one drawback to doing it your way. Unlike Alex's solution, your
background color(s) won't change when the theme is changed. Every style
has an alternate background color that is defined in the CCS file. When the theme
is changed it would be desirable to change to an alternate background color
that is consistent with the new theme.

Brent
Brent
Posted: 06/12/2002, 2:56 PM

>>Refer to http://gotocode.com/art.asp?art_id=183&

Alex,
To get alternate colored lines, the article had me edit the html code to
create an alternate field line and populate it with an alternate set of labels whose
names begin with "Alt_" and then bind it to the table. Ok, so it took me a while to
get it up and running, but at least it worked, or so I thought, but with one big caveate.

The big drawback to this approach is now I have to duplicate
the event code for each of the existing fields (that have events) to the
Alt_ fields. The Alt_ fields are unique fields. Now I have to maintain twice the
amount of event code. Yikes! This is getting overly complicated just to
alternate row colors, don't you think? :(

Is there any easier way to use the grid's alternate row color for every
second line? TIA

Brent

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.