You cannot set up a binding using braces in AS. You need to use BindingUtils.
Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Sid Maskit Sent: Sunday, July 13, 2008 4:03 PM To: [email protected] Subject: [flexcoders] Re: Binding for Dynamic Datagrid I believe that binding assignments need to use strings. Try: myDG.dataProvider="{ myData }" Hope that helps, Sid http://CraftySpace.com <http://CraftySpace.com> --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "limhy0306" <[EMAIL PROTECTED]> wrote: > > Hi, > > I've tried using the suggestion: > > myDG.dataProvider={ myData } > > But compilation has syntax errors: rightbrace is unexpected. > > > > Also, I've read about the binding regarding changes to the property > for the ArrayCollection; that we need to use itemUpdated to inform > about changes to the list. > > Basically the myData is a list of a class: MyClass. > > public class MyClass > { > private var _evt:ArrayCollection; > > ....... > } > > The var _evt changes in real-time & this changes need to be > refreshed in the Datagrid. > > However, not all instances of MyClass stored in myData changes. > In this case, I only want to redraw parts of the Datagrid that > changes only. > > Thank you. > > Regards. > > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , Simon Bailey <Nutrix@> wrote: > > > > myDG.dataProvider={ myData } > > > > On 7 Jul 2008, at 16:26, limhy0306 wrote: > > > > Hi, > > > > I've created a custom Dynamic Datagrid component. I would like to > > ask, how can I bind data to this DG? > > > > My codes: > > > > // Data to the datagrid. This data is dynamically changing. > > [Bindable] > > public var myData:ArrayCollection(); > > > > public var myDG:MyDG; > > > > // Called when creationComplete > > private function init() > > { > > myDG = new MyDG(); > > myDG.createDataGrid(); // Create the datagrid > > myDG.dataProvider = myData; //Would this bind the data? > > this.addChild(myDG); > > } > > > > I've noticed that when myData changed, myDG is not updated. In > fact, > > the set data() function of the ItemRenderer used in myDG is not > > being called when I call myData.refresh(). > > > > Is it the problem that I am not binding myDG correctly? > > > > Thank you. > > >

