I'm combining two arrays into a temp arrayCollection and setting the temp source into a new arrayCollection dataProvider = new ArrayCollection(tempAC.source);
This dispatched a CellectionEvent.COLLECTION_CHANGED event with kind=reset, and should update the DG... On Wed, Dec 24, 2008 at 7:08 PM, Tracy Spratt <[email protected]> wrote: > How are you updating the data provider items? If you are using the > collection API, like setItemAt(), the necessary events will be dispatched > and the DataGrid will visually update. If you are directly assigning > propety values to individual items, then you will need to call > itemUpdated(item). > > > > Tracy > > > ------------------------------ > > *From:* [email protected] [mailto:[email protected]] *On > Behalf Of *Sefi Ninio > *Sent:* Wednesday, December 24, 2008 5:02 AM > *To:* [email protected] > *Subject:* [flexcoders] Datagrid not updating when dataProvider is > changed. > > > > Hi all. > > I have a wierd situation, hopefully someone here can help. > > I have a DataGrid's dataprovider bound to an myDP ArrayCollection (it is > defined as [Bindable]). Each column in the DG has a labelFunction. > When I set the myDP values for the first time, everything is sweet, the > data is displayed correctly. > > When I update the myDP with new data, however, everything goes wrong. The > labelFunctions still get the stale data (from before the update), and so the > grid shows old data. > I verified the new data is updated to the DG's dataProvider (added a > listener to datagrid for CollectionEvent.COLLECTION_CHANGE - the new data is > updated in the DG dataprovider - checked in event's currentTarget). > > I can't understand why the dataprovider is updated and still the > labelFunction's item:Object contain old data... > > Any ideas anyone? > > Thanks, > Sefi > > >

