Well a regular s:DataGrid you could loop through the rows checking each column 
you have then change the visibility of a column without any data.

Number of rows: yourDataGrid.dataProviderLength
List of columns: yourDataGrid.columns
Number of columns: yourDataGrid.columnsLength

Hide/Show column:  yourDataGrid.columns.getItemAt(index).visible = true/false


If your data is coming from a server/database you may just send a few values 
back showing which columns are empty since you might be looping to read records 
anyways.

Not sure how the same idea would work with the AdvancedDataGrid, but it does 
have a columns and dataProvider properties.  Just have to get the lengths from 
those properties directly.





-Mark

-----Original Message-----
From: Oleg Konovalov [mailto:oleg...@gmail.com] 
Sent: Saturday, January 12, 2013 15:45
To: dev@flex.apache.org
Subject: Dynamic DataGrid

Hi,

I am trying to create dynamic DataGrid,
which shows columns only if it contains data
return by query (it has 10+ columns, so not easy to calculate sizes)..
I read a lot of posts on the net, tried  minWidth, ResizeMode, etc.

Nothing really useful which works.
In most cases  it created very narrow columns except the last one - super
wide.

Please help!

(using Flex4 AdvancedDataGrid)

-- 
Thank you in advance,
Oleg.

Reply via email to