4 Replies Latest reply on Feb 15, 2008 10:33 AM by paulo.larini

    XML in a DataGrid

    paulo.larini Level 1
      Hi, I´m having troubles in displaying XML in a data grid. In my example I don´t create the columns manually and I want that tlex create then automaticly:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      import mx.collections.XMLListCollection;
      import mx.collections.ArrayCollection;
      [Bindable] private var dados:XML =
      <employees>
      <employee>
      <name>Christina Coenraets</name>
      <phone>555-219-2270</phone>
      <email>ccoenraets@fictitious.com</email>
      <active>true</active>
      </employee>
      <employee>
      <name>Louis Freligh</name>
      <phone>555-219-2100</phone>
      <email>lfreligh@fictitious.com</email>
      <active>true</active>
      </employee>
      <employee>
      <name>Ronnie Hodgman</name>
      <phone>555-219-2030</phone>
      <email>rhodgman@fictitious.com</email>
      <active>false</active>
      </employee>
      <employee>
      <name>Joanne Wall</name>
      <phone>555-219-2012</phone>
      <email>jwall@fictitious.com</email>
      <active>true</active>
      </employee>
      <employee>
      <name>Maurice Smith</name>
      <phone>555-219-2012</phone>
      <email>maurice@fictitious.com</email>
      <active>false</active>
      </employee>
      <employee>
      <name>Mary Jones</name>
      <phone>555-219-2000</phone>
      <email>mjones@fictitious.com</email>
      <active>true</active>
      </employee>

      </employees>

      ]]>
      </mx:Script>
      <mx:DataGrid id="dg1" dataProvider="{dados.employee}"/>
      </mx:Application>