Okay well the reason I thought it may be the case was each column added takes just that little bit longer. After 20 or so columns it can take maybe 1.5 seconds.
The DG has a horizontal scroll policy of on. If thats what you mean by columns have to shift. Also I noticed that columns are shifting because they were ordered by column name and my add column button was naming the columns data filed. col1 col2 etc so after 10 there was switching occuring. Also the way I set the columns array is as follows. dg.columns = []; dg.columns = myColumnArrayVariable. This is because changes to the columns array don't seem to be picked up unless set to a different array first. Regards, Wes On Tue, Mar 24, 2009 at 6:57 PM, Alex Harui <[email protected]> wrote: > I don’t think it is column invalidation that is the problem. The > fundamental DG update mechanism is row-based. If you add a column other > columns’ sizes will likely be affected. How are you adding a column such > that the DG wouldn’t get wider or columns have to shift? > > > > I’d make sure the expensive renderer is optimized as much as possible. > Make sure you don’t do updates if values don’t change. > > > > Alex Harui > > Flex SDK Developer > > Adobe Systems Inc. <http://www.adobe.com/> > > Blog: http://blogs.adobe.com/aharui > > > > *From:* [email protected] [mailto:[email protected]] *On > Behalf Of *Wesley Acheson > *Sent:* Tuesday, March 24, 2009 8:55 AM > *To:* flexcoders > *Subject:* [flexcoders] Change DataGrid Columns > > > > I'm hoping that someone would be able to help me with this. > > Is it possible in theory to subclass DataGrid to add and remove columns in > such a way that not all the columns are invalidated? Basically I've got an > ItemRenderer which is quite expensive, Changing all the item renderers > doesn't make sense. > > I'm guessing that the add column would need to add something to columnMap > and freeItemRenderersTable although as far as I can see neither of these > seem to be used within the DataGridClass, and I would have to stop the > columnRendererChanged property from changing for existing columns. > > Anyone able to help or point me in the correct direction? > > Regards, > > Wes > > > > >

