tags:

views:

267

answers:

2

I have a DataGrid that has between 4-10 columns. I want the columns to be of width '50'. I have already set the width attribute in MXML. I am using "colName.hide = true" to hide various columns depending on whether I have data. I find that my columns expand when I have less columns. Is there a way to set the max width of a column or force it to keep the same width?

+1  A: 

You have to leave one column with undefined width - it will stretch when parent (grid) will be resized.

Or, you should recalculate and apply width of the greed dynamically

Vugluskr
I went back and did it this and it works much better.
Ryan H
+2  A: 

Why not just resize the width of the datagrid itself to 50 * amtOfCols when columns are hidden and shown?

Chris Klepeis
This is what I ended up doing yesterday. It isn't as elegant as I would have liked but it worked:) I would have preferred to keep it the width and height of the datagrid in percent form. I couldn't do that because it kept going crazy.
Ryan H