I'm confused as to how the drawHeaderBG function relates to moving a scrollbar. Regardless, this should move you in the right direction:

for (var i=0;i<20;i++){
        foo.push({test:"blah"});
}
dg.dataProvider = foo;
onEnterFrame = function(){
        dg.vSB._x = dg.width + 10;
        dg.mask_mc._width = dg.width - 4;
}

This is a very bad hack that manually fudges over the scrollbar, and moves the mask so that it shows what was orginally hidden by the scrollbar. This isn't fully complete, since when you select a row you can see that it still is compensating for a scrollbar that isn't there. Still, this is in the general direction....

C



ScriptJunkies wrote:
Hey,

I'm currently working on a flash app that uses a datagrid, I've come across a problem with customizing this component, Does anyone know if it's possible to change the scrollbar position?, i want there to be a gap between the datagrid and it's scrollbar, I've tried playing with the styles etc.. but can't find a way to do this.

I found the following example for changing the header color, would it be possible to do something like this?

mx.controls.DataGrid.prototype.drawHeaderBG = function(Void) {
var mc:MovieClip = this.header_mc;
mc.clear();
var clr:Number = this.getStyle("headerColor");
var o:Object = 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();
};



Thanks, Dave
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to