1 Reply Latest reply on Nov 2, 2006 7:47 AM by valerioV

    dataGrid and ItemRenderer, strange data behavior

    valerioV
      Hi,

      Maybe I have a strange question!
      I have my datagrid with an arrayCollection as dataProvider and 6 columns.
      Three of that have a item renderer inside (1 with a comboBox and 2 with a textInput).
      When a user insert a new item or scroll the dataGrid, the values inside the itemrenderer objects are disappearing or changing randomly.
      Here my source-code:

      <mx:DataGrid x="10" y="16" height="96" width="683" horizontalScrollPolicy="on" headerStyleName="testata" horizontalScrollBarStyleName="myScroll" verticalScrollBarStyleName="myScroll" dataProvider="{arrayVie}" >
      <mx:columns>
      <mx:DataGridColumn headerText="Num" width="40" dataField="re_tel"/>
      <mx:DataGridColumn headerText="Descrizione" width="150" dataField="col2">
      <mx:itemRenderer>
      <mx:Component>
      <mx:Canvas width="100%" height="20" verticalScrollPolicy="off" horizontalScrollPolicy="off">
      <mx:ComboBox x="-1" y="-1" width="100%" height="22" fontWeight="normal" editable="true">
      <mx:String></mx:String>
      <mx:String>Abitazione</mx:String>
      <mx:String>Agenzia</mx:String>
      <mx:String>Filiale</mx:String>
      <mx:String>Ufficio Curatore</mx:String>
      </mx:ComboBox>
      </mx:Canvas>
      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>
      <mx:DataGridColumn headerText="Indirizzo" width="200" dataField="re_indirizzo" editable="true">
      <mx:itemRenderer>
      <mx:Component>
      <mx:TextInput width="100%" text="{data.re_indirizzo}" />
      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>
      <mx:DataGridColumn headerText="CAP" width="60" dataField="re_cap" editable="true">
      <mx:itemRenderer>
      <mx:Component>
      <mx:TextInput width="100%" text="{data.re_cap}" />
      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>
      .............

      How can I solve this problem?

      Thanks
      Valerio