title: Flex/DataGrid: update each row dataProvider is changed
body: <p>In a DataGrid, how can I force data() of all itemRenderers on visible rows to be called when I've made an update to the dataProvider. </p>
  
  <p>I'n the following the Grid isn't updated after pressing doSomething. If I have a large list the update is done when scrolling down and then back up again, or in the case of the TreeGrid i open/close a node. </p>
  
  <pre><code>&lt;?xml version="1.0" ?&gt;
  &lt;mx:VBox
  xmlns:mx="http://www.adobe.com/2006/mxml"
  xmlns:flexlib="http://code.google.com/p/flexlib/"
  initialize="_initialize()"&gt;
  
  &lt;mx:Script&gt;
  &lt;![CDATA[
  
      import mx.events.CollectionEvent;
  
      import mx.controls.Alert;
      import Icons;
  
      [Bindable]
      private var dataProvider0:XML;
  
      private function _initialize():void
      {
          dataProvider0 = &lt;node&gt;
                  &lt;node label="A" option="1"&gt;
                      &lt;node label="C" option="1"/&gt;
                      &lt;node label="D" option="1"/&gt;
                  &lt;/node&gt;
                  &lt;node label="B" option="1"&gt;
                      &lt;node label="E" option="1"/&gt;
                      &lt;node label="F" option="1"/&gt;
                  &lt;/node&gt;
              &lt;/node&gt;;
  
      }
  
      private function doSomething():void
      {
  
          dataProvider0.node[0].@option = 0;
          dataProvider0.node[0].node[0].@option = 0;
  
  
      }
  
  
  ]]&gt;
  &lt;/mx:Script&gt;
  
  &lt;flexlib:TreeGrid
      id="treeGrid1"
      width="500"
      height="300"
      showRoot="false"
      verticalTrunks="none"
      paddingLeft="0"
      disclosureClosedIcon="{Icons.folderClosed}"
      disclosureOpenIcon="{Icons.folderOpen}"
      dataProvider="{dataProvider0}"&gt;
  
      &lt;flexlib:columns&gt;
          &lt;flexlib:TreeGridColumn dataField="@label" headerText="Section"/&gt;
          &lt;mx:DataGridColumn dataField="@option" headerText="Option" width="50"&gt;
              &lt;mx:itemRenderer&gt;
                   &lt;mx:Component&gt;
  
                      &lt;mx:Box xmlns:mx="http://www.adobe.com/2006/mxml" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" verticalAlign="middle" horizontalAlign="center" width="100%" height="100%"&gt;
  
                          &lt;mx:Script&gt;
                          &lt;![CDATA[
  
                              [Bindable]
                              override public function set data(value:Object):void
                              {
                                  super.data = value;
                                  chkMain.selected = value.@option == "1";
                              }
  
                          ]]&gt;
                          &lt;/mx:Script&gt;
  
                          &lt;mx:CheckBox id="chkMain"/&gt;
  
                      &lt;/mx:Box&gt;
  
                  &lt;/mx:Component&gt;
              &lt;/mx:itemRenderer&gt;
          &lt;/mx:DataGridColumn&gt;
      &lt;/flexlib:columns&gt;
  
  &lt;/flexlib:TreeGrid&gt;
  
  &lt;mx:DataGrid
      id="dataGrid1"
      width="500"
      height="300"
      dataProvider="{dataProvider0.node}"&gt;
  
      &lt;mx:columns&gt;
          &lt;mx:DataGridColumn dataField="@label" headerText="Section"/&gt;
          &lt;mx:DataGridColumn dataField="@option" headerText="Option" width="50"&gt;
              &lt;mx:itemRenderer&gt;
                   &lt;mx:Component&gt;
  
                      &lt;mx:Box xmlns:mx="http://www.adobe.com/2006/mxml" paddingBottom="0" paddingLeft="0" paddingRight="0" paddingTop="0" verticalAlign="middle" horizontalAlign="center" width="100%" height="100%"&gt;
  
                          &lt;mx:Script&gt;
                          &lt;![CDATA[
  
                              [Bindable]
                              override public function set data(value:Object):void
                              {
                                  super.data = value;
                                  chkMain.selected = value.@option == "1";
                              }
  
                          ]]&gt;
                          &lt;/mx:Script&gt;
  
                          &lt;mx:CheckBox id="chkMain"/&gt;
  
                      &lt;/mx:Box&gt;
  
                  &lt;/mx:Component&gt;
              &lt;/mx:itemRenderer&gt;
          &lt;/mx:DataGridColumn&gt;
      &lt;/mx:columns&gt;
  
  &lt;/mx:DataGrid&gt;
  
  &lt;mx:Button label="Do" click="doSomething()"/&gt;
  
  &lt;/mx:VBox&gt;
  </code></pre>