Try validateNow() method. Must redraw all grid.
Edembq, also validateNow() doesn't work!!
Any other idea please??
Then try invalidate DisplayList()
This is not good idea, but if not work make the grid invisible and then make it visible again. I hope this will redraw the grid.
Noway, I give up!
I'm going to load the data from DB via RemoteObejct.
In the mean time, kinldy could the Adobe staff explain how to refresh a spark grid? In the flex 4.5 guide there isn't any description.
i think it may show some effect
ArrayCollection's refresh method should work and force a refresh on the datagrid. If it doesn't work, please include a small test case (< 20 lines).
I got this to work for me.
var s:Sort = new Sort();
var sf:SortField = new SortField("name",false,false);
s.fields = [sf];
(dg.dataProvider as ArrayCollection).sort = s;
(dg.dataProvider as ArrayCollection).refresh();
You should manuanly invoke dataGrid.dataProvider.itemUpdated(item,property,oldvalue,newValue) to notify DataGrid to refresh specaily cell display.
The root cause is that:
<s:ArrayCollection id="testData" >
the ArrayCollection's Items is a Object, that does not extends EventDispather, so if you change some item's property, that can not automatically fire PropertyChage Event, at that time, you should manunaly use itemUpdated(xxx) to fire the Event.
Another solution is that, you can write an Business Object to do that.