1
votes

This feels like it should be a fairly simple issue but we've been at it all day and cant' figure it out.

We're using the default Flex Datagrid with no ItemRenderer. Our grid is linked to an model which is an ArrayCollection. There are a number of buttons on our screen which changes the model. (i.e 'Today' shows today's data, 'clicking' all shows all the data, etc.)

If I click on all and our grid fills up , then we must scroll down to see that information and it works fine. But then when I click on another button and the data in the dataprovider changes, the datagrid shown isn't rendering properly - if I scrolled down three lines, after the datagrid changes, the 3 first 3 linesdon't display until i play around with the scroller.

Any help would be useufl.

Thanks, Patrick

1
Not sure if this helps but I noticed that if I don't pre-set my columns, everything works fine. The problem is I don't want to show everything - I just want to show a few columns.fufonzo
Please share some code. How are you changing the dataProvider? Are you replacing it? Or modifying items inside it? If the latter, you'll have to use itemUpdated() to force the renderer to refresh. [Even if you didn't create your own renderer, you're still using the default one]JeffryHouser

1 Answers

0
votes

The following worked for me. I just invalidated the display list for the grid on creation complete.

<mx:Script>
  private function updateGrid(event:Event):void {
    event.currentTarget.invalidateDisplayList();
  }
</mx:Script>

<mx:DataGrid creationComplete="updateGrid(event)">
  <!-- stuff... -->
</mx:DataGrid>