Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-23-2004, 08:21 AM   #1
sfungus
Registered User
 
Join Date: Jul 2004
Posts: 4
Default DataGrid customization woes...

First off, this is Flash MX 2004... I've tried any and all combinations to attempt to get rid of the white gradient occuring on the headers for my DataGrid, and nothing is working. Here's what I've got going on:

grid.setStyle("vGridLineColor", 0xE2202B);
grid.setStyle("hGridLineColor", 0xE2202B);
grid.setStyle("headerColor", 0xE2202B);
grid.borderColor = 0xE2202B;
grid.backgroundColor = 0xE2202B;
grid.setStyle("fontSize", "9");
grid.borderStyle = "none";
grid.useRollOver = false;
grid.setStyle("headerColor", 0xE2202B);
grid.headerStyle.setStyle("fontSize", "11");
grid.headerStyle.setStyle("fontWeight", "bold");
grid.headerStyle.setStyle("color", 0xFFFFFF);

All of this looks great, but I can't get rid of the white gradient running from the bottom up on the header. From what I can tell, it's a highlightColor issue, but I've tried setting the highlightColor to 0xE2202B in a 1000 different ways, none of which work. Any help would be appreciated.

Also, I'm experiencing some difficulty setting column widths... where does this need to occur? When the grid is being created, or when a column is being created?

thanks!
sfungus is offline   Reply With Quote
Old 07-29-2004, 09:36 PM   #2
Knieval
Registered User
 
Join Date: Jul 2004
Posts: 1
Default

Hi,

I've also been trying things out with the Flash MX 2004 datagrid. I can't help you to lose the white gradient unfortunately, but I can tell you how to set the column widths. Pretty simple actually:

Code:
grid.getColumnAt(0).width = value;
grid.getColumnAt(1).width = value;
grid.getColumnAt(n).width = value;
Just fill in the index of the column and the number of pixels in value as large as the width should be. I've experienced that you should edit the widths after you've filled the grid with data.

Hope this helps you!

Greets
Knieval is offline   Reply With Quote
Old 07-30-2004, 12:44 AM   #3
kAd
Registered User
 
kAd's Avatar
 
Join Date: Jun 2004
Location: Chile
Posts: 20
Send a message via Yahoo to kAd
Default

take a look to

http://philflash.inway.fr/dgstyle2/dgstyle2.html

and

http://philflash.inway.fr/dgstyle/dgstyle.html

its in french, but you can use a translation service....
kAd is offline   Reply With Quote
Old 07-30-2004, 02:32 PM   #4
clem_c_rock
Senior Member
 
Join Date: Apr 2004
Posts: 108
Default

Hello,

Here's some things to try:

list_grd.setStyle("hGridLines", true);
list_grd.setStyle("hGridLineColor", 0xC1D1E0);
list_grd.setStyle("vGridLines", true);
list_grd.setStyle("vGridLineColor", 0xC1D1E0);
list_grd.setStyle("borderStyle", "inset");
list_grd.setStyle("buttonColor", 0xFFFFFF);
list_grd.setStyle("highlightColor", 0xFFFFFF);
list_grd.setStyle("borderCapColor", 0xFFFFFF);
list_grd.setStyle("shadowCapColor", 0xFFFFFF);
list_grd.setStyle("shadowColor", 0x336699);
list_grd.setStyle("borderColor", 0xFFFFFF);
clem_c_rock is offline   Reply With Quote
Old 08-01-2004, 11:37 PM   #5
grizjr
Registered User
 
Join Date: Jul 2004
Posts: 63
Default Hello

This is sad but true, but there is no easy way of removing the white gradient. Customizing the datagrid set me back 2 weeks when I finally just gave up. I recommend you get out while you still can and make your own datagrid with duplicatemovieclip. It might seem like its hard and time consuming but the end result is much quicker than trying to customize that damn thing.

Also, when I had the grid in my library, compiling time was considerably longer, when I took it out it was a big relief.

James
grizjr is offline   Reply With Quote
Old 08-03-2004, 03:19 AM   #6
sfungus
Registered User
 
Join Date: Jul 2004
Posts: 4
Default Well...

I finally opted just to turn off the headers completely and make my own in the movie itself. Stupid, stupid, stupid macromedia.
sfungus is offline   Reply With Quote
Old 08-03-2004, 09:47 AM   #7
theflux
Member
 
Join Date: Jul 2004
Posts: 60
Default

I am having my own problems with the DataGrid, like not being able to set the selected item with actionscript while the DataGrid is not editable. You would think that would be a simple task, like it is for the VB6 Grids, but you would be wrong. Is there a fair priced commercial component (or better yet a free one)?
theflux is offline   Reply With Quote
Old 08-24-2004, 07:12 AM   #8
blueskies
Registered User
 
Join Date: Aug 2004
Posts: 1
Default

To remove gradient from header on global basis, you will need to comment out the following code in DataGrid.as [you will need MX 2004 Pro]:

//mc.beginGradientFill("linear", colors, alphas, ratios, matrix);

//mc.lineStyle(0, 0x000000, 0);
//mc.lineTo(tot, o.top);
//mc.lineTo(tot, __headerHeight+1);
//mc.lineStyle(0, 0x000000, 100);
//mc.lineTo(o.left, __headerHeight+1);
//mc.lineStyle(0, 0x000000, 0);
//mc.endFill();

Then, you will need to open up StandardComponents.fla. You will need to change classpath to [your hard drive\Macromedia\Flash MX 2004\en\First Run\Classes] - my default path was wrong when I opened it.

Highlight the DataGrid component in document library. Right click and choose 'Convert to Compiled Clip'. You can rename to whatever you like [DataGrid SWF].

Drag and drop new compiled component to the Stage of your movie. As usual, you should use setStyle to change headerColor, etc. i.e. setStyle("headerColor", 0x000000);

Enjoy.
blueskies is offline   Reply With Quote
Old 09-20-2005, 09:27 PM   #9
fishmonger
Registered User
 
Join Date: Jun 2005
Posts: 16
Default

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();
};
//custom header

found this script around google, works like a charm for solid headers.
fishmonger is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:45 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.