TrajiklyHip - Blog - The Personal Blog of Aaron West
The Four Obsessions of an Extraordinary Executive by Patrick Lencioni         The Five Temptations of a CEO by Patrick Lencioni         Getting Things Done by David Allen         The Tin Roof Blowdown by James Lee Burke         The 7 Habits of Higly Effective People by Stephen R. Covey         Books I've recently read and recommend!
November 3, 2006

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 posting

If 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.

Related Blog Entries

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Thanks for puking all over the Adobe Aggregator!
# Posted By MXNA | 11/7/06 11:14 AM
Ugh. Huh?
# Posted By Aaron West | 11/7/06 1:44 PM
Ahh I see what happened. Geez, what a bummer. I've spoken with some folks in the know and apparently this is a known issue with MXNA. Gonna blog about this right now.
# Posted By Aaron West | 11/7/06 1:59 PM
Hey Aaron, just wanted to let you know that during the exploration for my latest post I discovered the solution for your "one itemRenderer updates another" issue. If you make the whole class that is used in your dataProvider (PersonVO or whatever) Bindable, and update the values in the data override of one, the other should automatically update, as long as you've correctly overridden the data method in it. Make sense?
# Posted By Ben | 11/17/06 3:14 PM
Nice reserch buddy ! buck up ! But i m facing another problem
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
# Posted By pankaj | 3/7/07 12:44 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.5.005.