views:

29

answers:

1

Hi, I have a ArrayCollection, containing a set of Value Objects. This ArrayCollection populates a DataGrid. I'm loading data into the ArrayCollection via a HTTPService call to the server. Once the first server call is made, I then start making repeated calls to the server to make sure I have the latest data (financial prices) shown in the datagrid. When I get a new update, all the data in the grid is reloaded, which causes some flickering of the data.

How can I only update certain columns of my datagrid, when I have a new set of data returned from the server?

Stephen

A: 

Instead of replacing the dataProvider of your DataGrid, you'll have to update individual elements. Basically, loop over the new data and the old data; check similar elements and if the data is updated replace that VO.

This should fire off the collectionChanged event of your ArrayCollection which should refresh the itemRenderer of the appropriate cells in the DataGrid.

However, I would expect this to be less performant than simply replacing the dataProvider. In theory this should cause less flicker since you aren't updating everything, just the elements that need updating.

www.Flextras.com