I'm still working through some minor DataGrid issues with custom ItemRenderers. Through reading various blogs and posts on FlexCoders, I came across the absolute best explanation of how DataGrids work behind-the-scenes. Ben (sorry I don't know his last name) has posted a sample DataGrid / ItemRenderer application where he explains how DataGrids operate on and display data from their data providers. Here is an excerpt from his posting:
from Ben's blog postingIf your DataGrid's dataProvider has 100 items, but it is only big enough to display 10 at any given time, the DataGrid only actually draws 10 items, in order to maximize performance. When you scroll the DataGrid there aren't any new items being drawn, it is simply swapping the data properties between the already drawn items. So scrolling down one row means that the piece of data for the second item is switched to be the data for the first item, the second item receives the third item's data, and so on and so on. During these reassignments, things like whether or not the CheckBox should be checked get all messed up. Some get checked, some get unchecked... its completely unpredictable. To handle this problem, we must override the data's setter method and use our own logic to determine whether or not the CheckBox should be checked.
What a clear explanation of how things work! As I mentioned earlier I'm still working through some issues with my application. I'll be finishing it up over the next few days at which point I'll be posting a follow-up to my previous "DataGrid Woes" post.













with data Grid that i create a grid at run time now i want to
item render component at run time if any body have solution then plz inform