1 Reply Latest reply on Dec 15, 2006 4:42 PM by FlightGuy

    Changing each row in a data grid to a different color

    xyco45 Level 1
      Okay if it is possible..... could some one please be nice enough as to explain how? It would be a huge help!


      thanx much in advanced...
        • 1. Re: Changing each row in a data grid to a different color
          FlightGuy Level 1
          Maybe - it depends how many rows you want and how many colors you can come up with.

          The alternatingItemColors style allows you to set any number of colors, and will cycle through them. In other words, if you have 10 rows and specify 10 colors, each row will have its own color.

          If you want something fancier than that, you can extend the DataGrid and override the protected function drawRowBackgrounds().

          One of the things you always need to be aware of with all of the subclasses of ListBase, is that the rows get recycled. In other words, just because you have 50 rows of data, doesn't mean that 50 instances will be created - usually just as many as are displayed, plus a couple. I just mention this because if you start to see wierd results that would probably be why.