3 Replies Latest reply on Apr 28, 2006 6:25 PM by atlacatl

    DataGrid color?

    Level 7
      How do I change the Rollover color on a datagrid..

      With a combo or list box, it's pretty easy.. only with a datagrid I
      guess it doesn't work the same way..

      _global.styles.List.setStyle("rolloverColor", 0x5a6970);

      -Richard
        • 1. Re: DataGrid color?
          Vroox
          You have to watch the capital letters. It's "rollOverColor" not "rolloverCollor".

          Good Luck!
          • 2. DataGrid color?
            PayBas
            I use these settings for a little project of mine... I think it has most of the basic styling covered. You need to enter this at the actionscript of the DataGrid itself... not the timeline. Or you must replace all the "this" thingies.

            this.editable = true;
            this.setStyle("fontSize", 11);
            this.alternatingRowColors = Array (0x232329, 0x202025);
            this.backgroundColor = 0x000000;
            this.color = 0x9999BB;
            this.headerColor = 0x18181C;
            this.rollOverColor = 0x414153;
            this.textRollOverColor = 0x9999BB;
            this.selectionColor = 0x363646;
            this.textSelectedColor = 0x9999BB;
            this.vGridLines = true;
            this.vGridLineColor = 0x000000;
            this.hGridLines = false;
            this.hGridLineColor = 0x000000;
            this.setStyle("borderStyle", "none");
            this.setStyle("textAlign", "center");
            this.setStyle("scrollTrackColor", 0x1C1C20);


            And if you want to get rid of the gradient overlay on the headers you must paste this in your timeline:

            mx.controls.DataGrid.prototype.drawHeaderBG = function(Void) {
            var mc:MovieClip = this.header_mc;
            mc.clear();
            var clr:Number = this.getStyle("headerColor");
            var o bject = this.__viewMetrics;
            var tot:Number = Math.max(this.totalWidth, this.displayWidth+3);
            mc.moveTo(o.left, o.top);
            mc.beginFill(clr, 100);
            mc.lineStyle(0, 0x000000, 0);
            mc.lineTo(tot, o.top);
            mc.lineTo(tot, this.__headerHeight+1);
            mc.lineStyle(0, 0x000000, 0);
            mc.lineTo(o.left, this.__headerHeight+1);
            mc.lineStyle(0, 0x000000, 0);
            mc.endFill();
            };
            • 3. Re: DataGrid color?
              atlacatl
              Do you know how to get rid of the black shadow line under the header? much appreciated. thank you