I am using the same approach and have problem with sorting. It looks this way : 1.Datagrid is loaded with data. 2.User is clicking on any sortable column and grid is sorted by the column field. 3.Now user is changing name of table for data retrieval(DDLb click event), request is send to backend and corresponding array is assigned to datagrid.columns. 4.Request results are assign to datagrid through binding. And here goes the catch - as soon as new results are applied to the grid sorting is automatically applied by field from step 2. Grid has new set of columns and the old field does not exist in the set.
Do you have solution for the problem ? Thanks, Irina --- In [email protected], "e_baggg" <[EMAIL PROTECTED]> wrote: > > Tom- > The Datagrid component now has an attribute called columns. When you > dynamically create columns, add them to an array and set > datagrid.columns value to this array. > > To add or remove columns, just get a reference to that 'columns' > attribute and call normal array methods. > > I actually have a datagrid that has its columns change based on what > value is selected in a tree. I set up my different columns as Arrays > in the ModelLocator, and when a user clicks a tree, it switches the > datagrid's columns value with the correct Array (creating them if they > are not there already). > > --- In [email protected], Tom Fitzpatrick <tom@> wrote: > > > > The dynamic column methods for the datagrid seem to have disappeared > > between 1.5 & 2. > > > > I've looked around for examples or descriptions of Flex 2 > replacements > > for methods such as dataGrid.addColumn() and > dataGric.removeAllColumns() > > that were available in 1.5, but haven't come up with much. Anyone > have > > any pointers? > > > > - Tom > > > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

