Since you asked so nicely... here's what I understand about column
widths in the datagrid control after some experimentation.

First off it is the width property of the DataGridColumn that I'm
talking about.

If you put a value in the definition of all columns, when they get
rendered the relative size of the column widths is honored, even
through scaling of the width of the grid itself, so the widths seem to
be treated as proportions.

If you leave one or more of them blank the widths are treated as
pixels as far as I can tell.

What I routinely now do is have a numbering scheme for the widths
where I look at the narrowest column, call that, say, 10 then do
everything from there.  Here is a fragment of code from my app which
has nicely proportioned columns which keep their relative proportions
as the window the datagrid is in changes size.

<mx:DataGridColumn headerText="Name" width="30"/>
<mx:DataGridColumn headerText="Owner" width="25"/>
<mx:DataGridColumn headerText="Potential" width="15"/>
<mx:DataGridColumn headerText="Target" width="12" />
<mx:DataGridColumn headerText="%" width="10" />
<mx:DataGridColumn headerText="Geography" width="15"/>
<mx:DataGridColumn headerText="Sector" width="15"/>
<mx:DataGridColumn headerText="Product" width="15"/>
<mx:DataGridColumn headerText="Currency" width="7"/>
<mx:DataGridColumn headerText="Access" width="10"/>

So in your case I would be tempted to try 1, 1 and 1 for your widths
and see what happens.

SP

--- In [EMAIL PROTECTED], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> What happened when you gave each column the same fixed width?
> 
>  
> 
> ________________________________
> 
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Friday, April 13, 2007 9:30 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [flexcoders] Grid columns of fixed and equal width
> 
>  
> 
> Pretty please? Even a response telling me that it's a bonehead question
> and I'm a dolt for asking would tell me _something_. ;-)
> 
>  
> 
> Thanks!
> 
>  
> 
> --
> 
> Martin Cooper
> 
>  
> 
>        
> 
>       
> ________________________________
> 
> 
>       From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
>       Sent: Tuesday, April 10, 2007 11:41 AM
>       To: [EMAIL PROTECTED]
>       Subject: [flexcoders] Grid columns of fixed and equal width
> 
>       What is the "right" way to create a Grid that has a fixed number
> of
>       columns of equal width?
>       
>       What I need is a fixed 3-column layout to which I can
> dynamically add
>       cells. Regardless of the content of the cells, the column widths
> should
>       remain the same. Also, the columns would need to resize when the
> Grid is
>       resized. I'm basing this on the Grid layout because I also need
> the
>       column spanning capability that Grid gives me.
>       
>       Any hints would be a great help in getting me going.
>       
>       For extra bonus points ... what I *really* want is something
> more like
>       three VBoxes of equal width, so that the contents are not forced
> to
>       align vertically, as with a Grid, but where I also get the
> column
>       spanning that a Grid gives me. (This is more like newspaper
> layout,
>       except that I don't care about content flowing from one column
> to the
>       next.) However working with a Grid will get me going for now.
>       
>       Thanks very much!
>       
>       --
>       Martin Cooper
>


Reply via email to