You should be able to manipulate the columns dynamically. At least with the standard DataGrid, the.columns property returns a *copy* of the DataGridcolumns array, so it is critical after modifying that atrray that you re-assign it to the columns property.
var aDGCTemp:Array = myDataGrid.columns; //modify aDGCTemp, adding or removing, etc columns myDataGrid.columns = aDGCTemp; //THIS IS REQUIRED Tracy Spratt, Lariat Services, development services available _____ From: [email protected] [mailto:[email protected]] On Behalf Of Joao Coelho Sent: Monday, March 30, 2009 1:29 PM To: [email protected] Subject: [flexcoders] Re: Add/remove columns dynamically to AdvancedDataGridColumnGroup Adrian, Thanks for the input, I also thought of using that aproach since I will only be displaying 5 columns at most simultaneously and adding and removing columns as needed, main problem is depending on certain configurations the total number of columns (either visible or hidden) is not known. I could, of course, create a large amount of columns and it would solve the problem up to some point, but then I would have memory issues sooner or later due to display objects lingering around. Forgot to mention I also tried invalidating list, properties and display list of grid, to force rendering of the columns to no avail. --- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com, Adrian Williams <adri...@...> wrote: > > Joao, > > We faced a similar challenge (we have a report that the user can > customize and persist which columns to display) and instead of actually > removing the columns, we found it much simpler to manage the visibility > instead...affecting the column.visible property. So when their report is > loaded, we read their report/column setting from the db, then build the > report and cycle thru the columns, determining which ones are visible > and "turn off" the ones that aren't. > > Adrian >

