4 Replies Latest reply on Apr 4, 2008 11:24 AM by ntsiii

    arraycollection with 1 element not displayed in datagrid

    paulhergh
      hi i have an xml file like this (data.xml)
      <applications>
      <app>
      <pus_id>1</pus_id>
      <pus_nom>Her</pus_nom>
      <pus_prenom>Paul</pus_prenom>
      <pus_adresse>Iasi</pus_adresse>
      <pus_code>700010</pus_code>
      <pus_bonus>602</pus_bonus>
      </app>
      </applications>

      I am binding it to the data provider of a data grid:
      <mx:HTTPService id="userRequest" url="data.xml" useProxy="false" method="POST" showBusyCursor="true"/>
      <mx:Binding source="userRequest.lastResult.applications.app as ArrayCollection" destination="allUsr" />
      <mx:Binding source="allUsr" destination="dgUserRequest.dataProvider" />

      the data grid looks like this:

      <mx:DataGrid headerColors="[#F5DEB3, #FFE4B5]" rollOverColor="#FFE4B5" selectionColor="#FFE4C4"
      id="dgUserRequest" x="10" y="150" height = "350" change="{selectedItemChanged()}"
      creationComplete="{initDataGridData()}">
      <mx:columns>
      <mx:DataGridColumn headerText="Id" width = "40" dataField="pus_id" />
      <mx:DataGridColumn headerText="Nom" width = "150" dataField="pus_nom"/>
      <mx:DataGridColumn headerText="Prenom" width = "100" dataField="pus_prenom"/>
      <mx:DataGridColumn headerText="Adresse" width = "450" dataField="pus_adresse"/>
      <mx:DataGridColumn headerText="Code" width = "200" dataField="pus_code"/>
      <mx:DataGridColumn headerText="Bonus" width = "200" dataField="pus_bonus"/>
      </mx:columns>
      </mx:DataGrid>

      and for some reason the entry it's not appearing in the data grid.
      Anyway, if i'll make my xml file to contain 2 entries, the datagrid will display both entries....
      Pls help

      tnx for your time
      Paul