Hi Greg, The ICollectionView should dispatch events of type CollectionEvent. I think that's what propagates changes (at least that's the way it works in Hierarchical components like Trees).
Mark On 11 Mar 2007 20:11:35 -0700, Greg McCreath <[EMAIL PROTECTED]> wrote:
Thanks Alex, I'm not looking for when the dataSource is assigned, it more the second bit of what you have mentioned: "the ICollectionView will spew events which the DataGrid is listening for".
That what I am looking to hook into. How does the dataGrid get notified of
the change to the ICollectionView and it is possible to trap it? Greg. ------------------------------ *From:* Alex Harui [mailto:[EMAIL PROTECTED] *Sent:* Monday, 12 March 2007 1:22 PM *To:* [email protected] *Subject:* RE: [flexcoders] Data binding: How to detect data change has happened? In the mx.controls.DataGrid, the dataProvider property is not a var, it is a get/set function pair. When someone assigns dataProvider, the set function is called so we know it changed. All dataProviders must implement ICollectionView or will be wrapped in an ICollectionView. When you change things in an ICollectionView, the contract is the ICollectionView will spew events which the DataGrid is listening for. There is no general property watching in AS, so you have to define contracts and use events and whatnot. -Alex ------------------------------ *From:* [email protected] [mailto:[EMAIL PROTECTED] *On Behalf Of *Greg McCreath *Sent:* Sunday, March 11, 2007 3:36 AM *To:* [email protected] *Subject:* [flexcoders] Data binding: How to detect data change has happened? Hi all, I'm interested to know how in an object with a data binding I can detect a change in the datasource. For example, if I were to develop (say) a custom datagrid that (in MXML) a user of that datagrid can set the datasource property to something like "{ blah.blahblah}". Then, in that custom datagrid how do I detect that that blah.blahblah has changed and take some action when it does? In the custom component I do not want to know of the existence of blah.blahblah, just that it has changed and what its new value is. All help appreciated. Greg. ------------------------------ This email and any files transmitted with it may be confidential and are intended solely for the use of the individual or entity to whom they are addressed. This email may contain personal information of individuals, and be subject to Commonwealth and/or State privacy laws in Australia. This email is also subject to copyright. If you are not the intended recipient, you must not read, print, store, copy, forward or use this email for any reason, in accordance with privacy and copyright laws. If you have received this email in error, please notify the sender by return email, and delete this email from your inbox. ------------------------------ This email and any files transmitted with it may be confidential and are intended solely for the use of the individual or entity to whom they are addressed. This email may contain personal information of individuals, and be subject to Commonwealth and/or State privacy laws in Australia. This email is also subject to copyright. If you are not the intended recipient, you must not read, print, store, copy, forward or use this email for any reason, in accordance with privacy and copyright laws. If you have received this email in error, please notify the sender by return email, and delete this email from your inbox.

