Welcome, Guest. Please login or register.
Did you miss your activation email?
11 Mar 2010, 08:27:24 UTC
Forum home
+  flexdeveloper.eu Forum
|-+  Flex and ActionScript 3.0
| |-+  ActionScript 3.0 (Moderators: JMWhittaker, Jan K, thewarpedcoder, James)
| | |-+  Different Colours shown on DataGrid
« previous next »
Pages: [1] Print
Author Topic: Different Colours shown on DataGrid (Read 10137 times)
bb1234_00
Guest
« on: 21 Aug 2006, 14:14:49 UTC »

Hi,

   I would like to show some rows with different colours from others.  Like the following tables :-

row1
row2
row3
row4



I guess one of the best answers making use of XML + cascade stylesheet. Is this correct? If yes, please suggest how to do this. Thanks very much.
Logged
Elsa
Guest
« Reply #1 on: 21 Aug 2006, 14:44:59 UTC »

Hmm seems to be less than straightforward  :-/

I've found this example that might help you:
http://www.everythingflex.com/blog/1/2006/07/DataGrid-Row-Colors.cfm
Logged
flexy
Guest
« Reply #2 on: 21 Aug 2006, 15:08:58 UTC »

You'll need to extend the dataGrid component, and override the row colour setting to allow you to conditionally set it.

I found this LINK REMOVED which might help you construct your Class.

Looks fairly straight-forward, let us know how you get on with it!
« Last Edit: 20 Aug 2009, 16:39:12 UTC by flexy » Logged
Elsa
Guest
« Reply #3 on: 21 Aug 2006, 16:09:46 UTC »

Haha

You cheeky sod that's the same thing I linked to!
Just because you think it's straightforward  Mr. Actionscript Tongue

Straightforward would be being able to define it in JUST the (bastardised)CSS.

 Grin
Logged
flexy
Guest
« Reply #4 on: 21 Aug 2006, 20:12:05 UTC »

Quote
Just because you think it's straightforward  Mr. Actionscript Tongue

Not that easy, but probably the easiest! Definitely right about the CSS, would make sense to be able to reference rows, like 'getRowAt'... but that'd be way too easy, and give me nothing to do.

I'm shifting (stealing) this post to the AS3 section, as it's more related to that than MXML.
Logged
bb1234_00
Guest
« Reply #5 on: 30 Aug 2006, 06:36:29 UTC »

Thx Elsa and Flexy. I got it.
Logged
flexy
Guest
« Reply #6 on: 30 Aug 2006, 15:14:32 UTC »

Hey great! Glad that fixed it for you.  Wink
Logged
flexy
flexdeveloper.eu
Guru/Addict FD
*****
Posts: 2,842


Recovering Coffee Addict & Adobe Expert


WWW
« Reply #7 on: 20 Aug 2009, 16:38:43 UTC »

More examples/tutorials here:

http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&postId=61&productId=2

http://blog.everythingflex.com/2006/07/27/datagrid-row-colors/

http://butterfliesandbugs.wordpress.com/2007/07/11/using-an-itemrenderer-to-change-the-background-of-a-datagrid-cell/

Logged

Pages: [1] Print
« previous next »
Share this on: Twitter Twitter Del.icio.us del.icio.us Digg Digg
Jump to:

©2006-2010 Flexdeveloper.eu/Jodie O'Rourke. All rights reserved.
Adobe®, Adobe® Flash™, Adobe® AIR™ and Adobe® Flex™ are registered trademarks of Adobe Systems Incorporated in the United States and other countries. All rights reserved.

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC