Hi, my guess is that your "dataField" cannot support the complex "[EMAIL PROTECTED]"... it should be just a single field name.
To me the XML makes more sense (and is simpler) like this: > <mx:XMLList id="employees"> > <employee Id="1" gender="female"> > <name>Christina Coenraets</name> > </employee> > <employee Id="2" gender="male"> > <name>Maurice Smith</name> > </employee> > </mx:XMLList> this makes your dataField just "@gender" which I think should work. good luck. --- In flexcoders@yahoogroups.com, Luis Eduardo <[EMAIL PROTECTED]> wrote: > > > > i could solve part of my problem with a workaround, but not all is > working ok. (i could display the data but the sorting capability is gone). > someone have an ideia of how to make this on the rigth path? > i am using the "labelFunction" property of the datagrid like this: > > <?xml version="1.0"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> > <mx:Script> > <![CDATA[ > public function getRowLabel(item:Object, > column:DataGridColumn):String { > return [EMAIL PROTECTED]; > } > ]]> > </mx:Script> > > <mx:XMLList id="employees"> > <employee Id="1"> > <name gender="female">Christina Coenraets</name> > </employee> > <employee Id="2"> > <name gender="male">Maurice Smith</name> > </employee> > </mx:XMLList> > > <mx:Panel title="DataGrid Control Example" height="100%" width="100%" > paddingTop="10" paddingLeft="10" paddingRight="10"> > > <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" > dataProvider="{employees}"> > <mx:columns> > <mx:DataGridColumn dataField="@Id" headerText="ID"/> > <mx:DataGridColumn dataField="[EMAIL PROTECTED]" > headerText="Gender" labelFunction="getRowLabel"/> > <mx:DataGridColumn dataField="name" headerText="Name"/> > </mx:columns> > </mx:DataGrid> > > <mx:Form width="100%" height="100%"> > <mx:FormItem label="Id"> > <mx:Label text="[EMAIL PROTECTED]"/> > </mx:FormItem> > <mx:FormItem label="Name"> > <mx:Label text="{dg.selectedItem.name}"/> > </mx:FormItem> > <mx:FormItem label="Gender"> > <mx:Label text="[EMAIL PROTECTED]"/> > </mx:FormItem> > </mx:Form> > > </mx:Panel> > </mx:Application> > > > > ----------------------------------------------------------------------------------------------------------- > > > > > Luis Eduardo escreveu: > > > > > hi, > > > > i dont know why but my datagrid cant bind well when the format of one > > XML have childrens. > > i borrow the example on the documentation and make a test to you guys > > see what i am talking about. > > to see the issue, just select one row and watch the Labels get the > > "gender" property on the right way but, using the same notation, the > > grid can't show the values. > > > > thx for the help, > > > > Luís Eduardo. > > > > <?xml version="1.0"?> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml > > <http://www.adobe.com/2006/mxml>"> > > <mx:XMLList id="employees"> > > <employee Id="1"> > > <name gender="female">Christina Coenraets</name> > > </employee> > > <employee Id="2"> > > <name gender="male">Maurice Smith</name> > > </employee> > > </mx:XMLList> > > > > <mx:Panel title="DataGrid Control Example" height="100%" width="100%" > > paddingTop="10" paddingLeft="10" paddingRight="10"> > > > > <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" > > dataProvider="{employees}"> > > <mx:columns> > > <mx:DataGridColumn dataField="@Id" headerText="ID"/> > > <mx:DataGridColumn dataField="[EMAIL PROTECTED]" > > headerText="Gender"/> > > <mx:DataGridColumn dataField="name" headerText="Name"/> > > </mx:columns> > > </mx:DataGrid> > > > > <mx:Form width="100%" height="100%"> > > <mx:FormItem label="Id"> > > <mx:Label text="[EMAIL PROTECTED]"/> > > </mx:FormItem> > > <mx:FormItem label="Name"> > > <mx:Label text="{dg.selectedItem.name}"/> > > </mx:FormItem> > > <mx:FormItem label="Gender"> > > <mx:Label text="[EMAIL PROTECTED]"/> > > </mx:FormItem> > > </mx:Form> > > > > </mx:Panel> > > </mx:Application> > > > > > > _______________________________________________________ > > O Yahoo! está de cara nova. Venha conferir! > > http://br.yahoo.com <http://br.yahoo.com> > > > > > > > > > _______________________________________________________ > Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora! > http://br.mobile.yahoo.com/mailalertas/ > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/