I'm developing an AIR application using the 4.1 SDK and have come across inconsistent display behavior from a datagrid when scrolling.
My datagrid has three fixed columns created in MXML with the DataGridColumn tag. When the datagrid fires a creationComplete event, I then dynamically add additional columns to it, setting the column item renderer to an MXML component. This is all rather straightforward and when I start the application, everything looks just fine. However, once I scroll the datagrid, either vertically or horizontally, the values from the dynamically created columns change or empty cells are displayed in their place. They change every time I scroll. The fixed columns don't exhibit this behavior.
Has anyone encountered this issue? Is this a Flex bug and is there a workaround?
Your help is appreciated.
itemRenders in DataGrid and other list based controls are recycled, so this often causes problems for scrolling "depending on what you are doing".
Show code and we may be able to help more.
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
Flex Training and Support Services
Are you using custom renderers in the columns? Do they handle recycling
OK, after several more rounds of debugging, I have determined that this is definitely a recycling issue with my custom item renderer. Specifically, it's due to the way the renderer is binding to the data that is displayed in the grid.
Thank you both for pointing me in the right direction.