No, no, I'm just trying to make this key idea, "work-with-the-dataProvider", clear to the original poster, clearly a new Flex user. I don't even need to look at your example to know it is quality. I apologize for the misunderstanding.
Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Melby Sent: Friday, March 21, 2008 12:30 PM To: [email protected] Subject: Re: [flexcoders] Select all checkboxes in datagrid with a single click Tracy - Not sure if you are referring to my sample code. But, just in case you are... That code *does* update the underlying data provider. It simply does it generically using ICollectionView and IViewCursor. This is not looping over the renderers afaik. If it is, I'd sure like to know... cuz I wouldn't recommend doing that either :) Scott Scott Melby Founder, Fast Lane Software LLC http://www.fastlanesw.com <http://www.fastlanesw.com> http://blog.fastlanesw.com <http://blog.fastlanesw.com> Tracy Spratt wrote: > Yes that example in that other reply will show you how to do this, but I > want to make a key idea very clear. > > > > When working with data, one never (almost) "loops over the DataGrid". > One always works with the underlying dataProvider. This is because Flex > only creates the visible rows. When you scroll, or change the data, the > data from the underlying dataProvider item is assigned to the > itemRenderer, and the renderer must use that data to update its UI. > > > > In your case, the itemRender must set the CheckBox.selected property > from a value in the dataProvider item. > > > > Google "Harui itemRenderer" to find a full discussion and many examples. > > > > Tracy > > > > ________________________________ > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of p_repetti > Sent: Friday, March 21, 2008 7:16 AM > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Select all checkboxes in datagrid with a single > click > > > > > Hello > > I have created a DataGrid component whose last column is rendered/edited > with a checkbox. This checks whether the row data will be sent to the > server > or not. > Rather than forcing the user to check all of the rows manually, I have a > "Select All" button which commands the selection of all the checkboxes > in > that column. > My problem is that I can't write the code to implement the selection. It > is > AS code most likely, but I could not find an example going through > docs/forums/whatever. > How do I loop over the DataGridColumn object to get the CheckBox > instances ? > > Can anyone point me to useful examples/references ? > > Thanks >

