1 Reply Latest reply on Mar 17, 2010 1:12 AM by Aman_SS

    how to get after changing itemrenderer combobox new values in datagrid

    peddireddyss

      Hi All,

       

       

         Am struggling since last twodays how to get datagrid data after changing column item renderer (combobox).Am getting simple editing data but am unable to get itemrenderer data please help me this is very urgent.Please give some useful suggessions.

       


      main.mxml

       

       

      <?xml version="1.0"?>
      <!-- dpcontrols/DataGridPassData.mxml -->
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
         initialize="initData()">
         <mx:Script>
         <![CDATA[
            import mx.collections.*;
            private var DGArray:Array = [
               {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99},
               {Artist:'Pavement', Album:'Brighten the Corners', Price:11.99}];
              
            [Bindable]
            public var initDG:ArrayCollection; 
            public function initData():void {
               initDG=new ArrayCollection(DGArray);
            }
            private function checkme():void
            {
                var tarr:ArrayCollection = this.myGrid.dataProvider as ArrayCollection;

               
            }
         ]]>
         </mx:Script>

       

         <mx:DataGrid id="myGrid" width="350" height="200"
            dataProvider="{initDG}" >
            <mx:columns>
               <mx:DataGridColumn dataField="Album" />
               <mx:DataGridColumn dataField="Price" />
               <mx:DataGridColumn itemRenderer="DGItemrenderer"/>
            </mx:columns>
         </mx:DataGrid>
         <mx:Button label="Check" click="checkme()"/>
      </mx:Application>

       

       

       

      DGItemrenderer.as

       

      package
      {
          import mx.controls.ComboBox;
         
          public class DGItemrenderer extends ComboBox
          {
              public function DGItemrenderer()
              {
                  dataProvider = ['Continue','Cancel','Change'];
              }

       

          }
      }

       

       

      Thanks and Regards,

      Subbareddy